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
2 parents 2926e32 + dc19b2f commit 453f94dCopy full SHA for 453f94d
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