-
Notifications
You must be signed in to change notification settings - Fork 66
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
Test for Enumeration support (#3411) #3429
base: main
Are you sure you want to change the base?
Conversation
The same error can be seen with a standalone repro: trait Base {
class InnerType {
def compare(that: InnerType): Int = 0
}
}
object OuterType extends Base {
def create: InnerType = new InnerType
}
val m = Surface.methodsOf[OuterType.InnerType]
In this case the type of the compare parameter is represented as:
When using |
With a significant effort I was able to manipulate the I am afraid this might be too difficult for me - there are too many unfamiliar concepts and too little documentation. |
Possible Scala 3 bugThis was due to a mistake on my part. I was able to create the correct type, yet in the result the type is interpreted as I think the type should be Workaround?As for supporting |
113fa34
to
a2131f1
Compare
6d5e1a4
to
3b2dd87
Compare
3b2dd87
to
744492b
Compare
I have stored my previous progress in enumeration-test-3411-type-tranformation branch and implemented the workaround here. I have checked the I suggest to see what will Scala 3 reaction to my bug report be. If the issue is not fixed and no alternative solution advised, I suggest proceeding with the simple workaround. Note: This is not a blocking issue for me now. I do not use |
Note: it seems the tests are currently failing with Scala 2 / Scala.js. See https://github.com/wvlet/airframe/actions/runs/8099295592?pr=3431:
The error is very similar to the one provided by Scala 3. The Scala 2 / JVM passes fine. I do not understand what this means. The Scala 3 error is: [error] -- [E007] Type Mismatch Error: /home/runner/work/airframe/airframe/airframe-surface/src/test/scala/wvlet/airframe/surface/i3411.scala:30:29 |
@OndrejSpanel Thank you for leaving the work log. I'm also not worried about supporting the legacy enumeration as Scala 3 enum is already supported. If we can just get Surface.methodsOf to compile, ignoring these enumeration methods that use dependent types is ok. I can take over this PR. thanks |
A fact which might be interesting: in the fork mentioned in #3440 (comment) I get the same compilation error with Scala 2.12 / Scala.js version:
I think it is again the |
Test for #3411
With Scala 3 the test currently fails with: