Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Float32 and Float64 to Msg conversions #613

Merged
merged 2 commits into from
Oct 21, 2024
Merged

Conversation

ramon54321
Copy link
Contributor

Small change to include Float32 and Float64 conversions in the Msg class. Currently there is no way to extract floats from Msg without a cast at the call site.

@ramon54321
Copy link
Contributor Author

ramon54321 commented Oct 21, 2024

Hello, thank you for your consideration, how does this work, can this be merged?

@lihaoyi lihaoyi merged commit 626e7a4 into com-lihaoyi:main Oct 21, 2024
8 checks passed
nox213 pushed a commit to nox213/upickle that referenced this pull request Dec 7, 2024
Small change to include `Float32` and `Float64` conversions in the `Msg`
class. Currently there is no way to extract floats from `Msg` without a
cast at the call site.

Co-authored-by: Li Haoyi <[email protected]>
nox213 added a commit to nox213/upickle that referenced this pull request Dec 7, 2024
Fixes com-lihaoyi#628

Sealed classes can be instantiated directly. Therefore, when generating
the typeTag, I included the sealed class itself. This ensures that the
macro correctly handles sealed classes without subclasses. To check
whether it’s a sealed class and not a trait or abstract class, I used
the following condition:
 ```
 sealedParents.find(_ == tpe.typeSymbol)
```
Since `trait` and `abstract class` cannot be instantiated, I believe this approach works. However, I could also explicitly check that the symbol is not a trait or an abstract class, if needed.

What do you think?

remove unused

wip

make scala2 works

Delete some files

Add more tests

more tests

scala3 writer

fix

polish

clean up

Add helper function

scala3 macro

readers

fix bug

test pass

polish

polish

wip

Add Float32 and Float64 to Msg conversions (com-lihaoyi#613)

Small change to include `Float32` and `Float64` conversions in the `Msg`
class. Currently there is no way to extract floats from `Msg` without a
cast at the call site.

Co-authored-by: Li Haoyi <[email protected]>

Update .mill-version (com-lihaoyi#627)

Update and rename build.sc to build.mill (com-lihaoyi#640)

fix

remove unused

Use ListBuffer to preserve orders

polish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants