File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -431,12 +431,8 @@ object Types {
431
431
if (lsym isSubClass rsym) lsym
432
432
else if (rsym isSubClass lsym) rsym
433
433
else NoSymbol
434
- case OrType (l, r) => // TODO does not conform to spec
435
- val lsym = l.classSymbol
436
- val rsym = r.classSymbol
437
- if (lsym isSubClass rsym) rsym
438
- else if (rsym isSubClass lsym) lsym
439
- else NoSymbol
434
+ case tp : OrType =>
435
+ tp.join.classSymbol
440
436
case _ =>
441
437
NoSymbol
442
438
}
Original file line number Diff line number Diff line change
1
+ object Test extends App {
2
+
3
+ var opCache : Int | Null = null
4
+
5
+ def foo (x : Int ) = {
6
+ if (opCache == null ) opCache = x
7
+ opCache.asInstanceOf [Int ] + 1
8
+ }
9
+
10
+ assert(foo(1 ) + foo(2 ) == 4 )
11
+
12
+ }
You can’t perform that action at this time.
0 commit comments