You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue seems to be either a mismatch between the type obtained from turning child symbol into Type, or something about handling of singleton types (modules). It's very subtle:
if we remove the whole children machinery and attempt to just:
if we comment out singletons implicit and replace it with explicitObject OR tagged (so that implicit resolution would not have to rely on <: Singleton type bound) it also works as expected
manual experiments shows that type constructed for SomeObject with sym.termRef.asType successfully pass TypeRepr.of[Subtype] <:< TypeRepr.of[Singleton] check while sym.typeRef.asType does not (however in my macros it breaks other things)
TypeRepr.of[A].memberType(sym) suggested in other issue for similar cases also does not work:
Compiler version
3.3.3
Minimized code
example.scala
:example.test.scala
:Output
Expectation
The issue seems to be either a mismatch between the type obtained from turning child symbol into
Type
, or something about handling of singleton types (modules). It's very subtle:if we remove the whole
children
machinery and attempt to just:then
works as expected
if we comment out
singletons
implicit and replace it withexplicitObject
ORtagged
(so that implicit resolution would not have to rely on<: Singleton
type bound) it also works as expectedmanual experiments shows that type constructed for
SomeObject
withsym.termRef.asType
successfully passTypeRepr.of[Subtype] <:< TypeRepr.of[Singleton]
check whilesym.typeRef.asType
does not (however in my macros it breaks other things)TypeRepr.of[A].memberType(sym)
suggested in other issue for similar cases also does not work:produces
and requires workaround for printing as
TypeRepr.of[Subtype].show
would crash the compilerThe text was updated successfully, but these errors were encountered: