We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
this.type
ValueOf
1 parent f40594c commit 1bcf664Copy full SHA for 1bcf664
compiler/src/dotty/tools/dotc/typer/Synthesizer.scala
@@ -231,6 +231,8 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
231
withNoErrors(success(Literal(Constant(()))))
232
case n: TermRef =>
233
withNoErrors(success(ref(n)))
234
+ case ts: ThisType =>
235
+ withNoErrors(success(This(ts.cls)))
236
case tp =>
237
EmptyTreeNoError
238
case _ =>
tests/pos/i23086.scala
@@ -0,0 +1,2 @@
1
+class Test:
2
+ val _: this.type = summon[ValueOf[this.type]].value
0 commit comments