File tree 2 files changed +13
-7
lines changed 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change
1
+ package dotty .tools
2
+
3
+ object WrappedResult {
4
+ opaque type WrappedResult [T ] = T
5
+ def result [T ] given (x : WrappedResult [T ]): T = x
6
+ def apply [T ](x : T ): WrappedResult [T ] = x
7
+ }
Original file line number Diff line number Diff line change @@ -24,11 +24,10 @@ package object tools {
24
24
def unsupported (methodName : String ): Nothing =
25
25
throw new UnsupportedOperationException (methodName)
26
26
27
- object WrappedResult {
28
- opaque type Type [T ] = T
29
- def unwrap [T ](x : Type [T ]): T = x
30
- def apply [T ](x : T ): Type [T ] = x
31
- }
32
- type WrappedResult [T ] = WrappedResult .Type [T ]
33
- def result [T ] given (x : WrappedResult [T ]): T = WrappedResult .unwrap(x)
27
+ export WrappedResult .{WrappedResult , result }
28
+ // Equivalent to:
29
+ // type WrappedResult[T] = WrappedResult.WrappedResult[T]
30
+ // def result[T] given WrappedResult[T] = WrappedResult.result[T]
31
+ // The export gave a CyclicReference error in some situations
32
+ // Investigate if this happens again.
34
33
}
You can’t perform that action at this time.
0 commit comments