File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
src/dotty/tools/dotc/transform Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ trait TypeTestsCasts {
100
100
* The transform happens before erasure of `argType`, thus cannot be merged
101
101
* with `transformIsInstanceOf`, which depends on erased type of `argType`.
102
102
*/
103
- def transformOrTypeTest (qual : Tree , argType : Type ): Tree = argType match {
103
+ def transformOrTypeTest (qual : Tree , argType : Type ): Tree = argType.dealias match {
104
104
case OrType (tp1, tp2) =>
105
105
evalOnce(qual) { fun =>
106
106
transformOrTypeTest(fun, tp1)
Original file line number Diff line number Diff line change
1
+ true
2
+ true
3
+ false
Original file line number Diff line number Diff line change
1
+ class Base {
2
+ type T = Int | Boolean
3
+ def test (x : Object ) = x.isInstanceOf [T ]
4
+ }
5
+
6
+ object Test {
7
+ def main (args : Array [String ]) = {
8
+ val b = new Base
9
+ println(b.test(Int .box(3 )))
10
+ println(b.test(Boolean .box(false )))
11
+ println(b.test(Double .box(3.4 )))
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments