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

166: fix compilation error in dotty #291

Closed

Conversation

scalavision
Copy link
Contributor

@scalavision scalavision commented Nov 21, 2020

Fixes #166

This makes dotty compile and it also still compiles for scala 2.13.3.

The problem is that you need to add parenthesis in the ShoppingSchema code. I've refactored out the dotty example from the scala2 example.

To make the dsl like syntax work for scala 3 I think we need to add the @infix annotation, but not sure if this will work with scala 2, so maybe this could be added later if needed?

@CLAassistant
Copy link

CLAassistant commented Nov 21, 2020

CLA assistant check
All committers have signed the CLA.

@scalavision scalavision changed the title wip: fix compilation error in dotty fix compilation error in dotty Nov 21, 2020
@scalavision scalavision changed the title fix compilation error in dotty issue 166: fix compilation error in dotty Nov 21, 2020
@scalavision scalavision changed the title issue 166: fix compilation error in dotty 166: fix compilation error in dotty Nov 21, 2020
@jczuchnowski
Copy link
Member

Yes, fixing the syntax is another problem. Great job here! I can finally enable Scala 3 checks in CI :)

@jczuchnowski
Copy link
Member

Ah, wait. test:compile is still failing. Can you take a look?

@scalavision
Copy link
Contributor Author

I have looked a bit more into this. It seems that dotty is not able to handle the deeply nested typelevel structure built using the ++ operator (if I understand things correctly here):

I have basically circumvented that by explicitly calling everything using parenthesis, thus I guess that dotty is able to infer this correctly when helped out. Unfortunately, this breaks the nice dsl like syntax of the sql.

I suspect this being a limitation in the dotty compiler, so maybe file an issue for this in dotty? I think dotty should be able to handle this. Alternatively, we could try to exclude the test sources for dotty, but I am a bit short on sbt magic, and it is not a solution in the long run anyways.

The assumption done earlier on infix annotation is wrong I think, because symbolic operators are supposed to be handled exactly as in scala 2.

@jczuchnowski
Copy link
Member

Is it possible it's dotty version we're using? We're stuck on 0.27.0-RC1 because of ZIO. Maybe on 3.0.0-M2 it'll get better. We could recheck with your PR zio/zio#4483

@scalavision
Copy link
Contributor Author

Thanks @jczuchnowski , compiling against scala 3.0.0-M2 and the branch (just published things locally) produces the same problems it seems. I'll make another go, and try to isolate the problems after release of new version of zio. I have made a PR with the changes that I think is compatible also with scala 2 here:

#343

Suggest closing this and see if we can find a better solution later :-)

@jczuchnowski
Copy link
Member

@scalavision ok, let's do that. I'll do some experiments with 3.0.0-M2 too.

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.

Fix Dotty compilation errors
3 participants