File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
compiler/src/dotty/tools/dotc/transform/init Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ object Summarization {
230
230
Summary .empty
231
231
232
232
case thisTp : ThisType =>
233
- val cls = thisTp.widen .classSymbol.asClass
233
+ val cls = thisTp.tref .classSymbol.asClass
234
234
Summary .empty + ThisRef (cls)(source)
235
235
236
236
case SuperType (thisTp, superTp) =>
Original file line number Diff line number Diff line change
1
+ object XObject {
2
+ opaque type X = Int
3
+
4
+ def anX : X = 5
5
+
6
+ given ops as Object {
7
+ def (x : X ) + (y : X ): X = x + y
8
+ }
9
+ }
10
+
11
+ object MyXObject {
12
+ opaque type MyX = XObject .X
13
+
14
+ def anX : MyX = XObject .anX
15
+
16
+ given ops as Object {
17
+ def (x : MyX ) + (y : MyX ): MyX = x + y // error: warring: Infinite recursive call
18
+ }
19
+ }
20
+
21
+ object Main extends App {
22
+ println(XObject .anX + XObject .anX) // prints 10
23
+ println(MyXObject .anX + MyXObject .anX) // infinite loop
24
+ }
You can’t perform that action at this time.
0 commit comments