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