-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Metaprogramming + existential type fails to compile #15357
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
Labels
area:metaprogramming:quotes
Issues related to quotes and splices
Comments
Workaround: inline def macroDef(inline t: T): t.A =
- ${ macroBody[t.A]('t) }
+ workaround(t)
+
+ inline def workaround[A](inline t: TA[A]): A =
+ ${ macroBody[A]('t) } |
It might be related to #13376 |
In inline def macroDef(inline t: T): t.A = ${ macroBody[t.A]('t) } I notice the use of |
Now it fails telling the user that -- [E083] Type Error: t/Test.scala:21:36 ---------------------------------------
21 | inline def macroDef(inline t: T): t.A =
| ^
|(t : ExistentialTypeParam.T) is not a valid type prefix, since it is not an immutable path
|
| longer explanation available when compiling with `-explain`
-- [E083] Type Error: t/Test.scala:22:17 ---------------------------------------
22 | ${ macroBody[t.A]('t) }
| ^
|(t : ExistentialTypeParam.T) is not a valid type prefix, since it is not an immutable path
|
| longer explanation available when compiling with `-explain`
-- [E007] Type Mismatch Error: t/Test.scala:22:22 ------------------------------
22 | ${ macroBody[t.A]('t) }
| ^
| Found: (t : ExistentialTypeParam.T)
| Required: ExistentialTypeParam.T{type A = ExistentialTypeParam.T#A}
|
| longer explanation available when compiling with `-explain` This also suggests the alternative workaround, which does compile. - inline def macroDef(inline t: T): t.A =
+ inline def macroDef(t: T): t.A = |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
3.1.2
Minimized code
Output
Expectation
Should compile.
The text was updated successfully, but these errors were encountered: