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

(WIP) Scala 3 cross compile #158

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hughsimpson
Copy link

@hughsimpson hughsimpson commented Aug 13, 2021

The innocuous bits:

  • bumping scalafmt, specs etc changes their API. Some old syntax doesn't work
  • Also means, for the time being, relying on release candidates

Lots of things still to figure out:

  • Can't get defaults working. Man, I don't know what's up with that
  • Some weird bullshit that means we can't use .as[Foo]("configObjectName") directly without casting first. This might be a dotty bug, I haven't minimised it yet
    Edit: this turns out to actually be a conflict with this test lib: where as is defined in a trait it's overriding the import, so we're seeing errors from the wrong method. Natural solution for now is probably to change the tests rsther than the API... (CF Methods available after implicit conversion are hidden by extension methods, even when signature does not match callsite scala/scala3#13300)
  • I changed the name of the parameter-free version to to as a result. I doubt it really helped
    Edit: it definitely did help, but since it's a conflict with implicits from tests only should be reverted (see above)
  • Assumes contructor methods are the only valid ones. This should be (compared to the above) relatively easy to fix (but still not fun)
  • I think there's some capability to declare bespoke config parsing? I haven't gone near that yet
  • Scala 3 enums are a whole extra barrel of fish

Would probably be sensible to take the scalafmt change and the syntactic restrictions as a single pr, and figure out how to make the macros work incrementally. I think I might forget about this, 'cause it's not even a direct dependency of mine, but thought it was only fair to show my working nonetheless. If there's any interest in this work I'm happy to split this pr up into mergeable and work-in-progress

@hughsimpson hughsimpson changed the title Scala 3 cross compile (WIP) Scala 3 cross compile Aug 13, 2021
@kailuowang
Copy link

kailuowang commented Aug 13, 2021 via email

@hughsimpson
Copy link
Author

hughsimpson commented Aug 15, 2021

To be completely honest I don't even use this. It's a dependency of a test dependency of a dependency that I can do without, this is just for fun really. I was pretty hesitant even to open the WIP for that reason but I'd put a few hours in and thought I'd gauge if there was any interest, in which case I might pursue this, if only as an excuse to fiddle with scala 3 macros a bit more. I won't be salty if this pr is closed with a 'won't fix' or whatever - not least because I'm aware how glaringly incomplete it is as a PR and because as it stands it would change the API

@kailuowang
Copy link

kailuowang commented Aug 16, 2021 via email

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