Failing to summon given Type[T]
instances with path-dependent types
#16959
Labels
Milestone
Type[T]
instances with path-dependent types
#16959
Compiler version
3.3.1-RC1-bin-20230216-2507577-NIGHTLY
This report contains three slightly different versions, one behaves unexpectedly, one crashes the compiler and one with a confusing compiler error. Not sure if the underlying cause is the same or if these are different issues.
Version 1 (Unexpected Behavior)
Minimized code
Output
When expanding, the macro prints:
Expectation
I would expect it to print:
int.Type
andstring.Type
are clearly different types (by their path) and should use their respective givens. I could not easily reproduce this behavior using custom types, which makes me think the compiler magic to summonType[T]
instances might be involved.Version 2 (Compiler Crash)
Another encoding (which I'm not really sure should actually compile) crashes the compiler (which, I suppose, should not happen):
Stack Trace
Version 3 (Confusing Error Message)
Given the following code:
The compiler produces the following error:
I'm not sure whether the code should compile, but the error message is not very helpful as it suggests missing type parameters for
int.Underlying
, which does not take type parameters.EDIT: I assume now what the last error message wants to say is:
int.Underlying
is<: AnyKind
, i.e., it may or may not take arguments; but the message is not very clear on this.The text was updated successfully, but these errors were encountered: