File tree Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ class A :
2
+ class B (val b : Int )
3
+
4
+ object O :
5
+ val o : A | Array [Int ] = new Array [Int ](10 )
6
+ o match
7
+ case a : A => new a.B (10 )
8
+ case arr : Array [Int ] => arr(5 )
9
+
Original file line number Diff line number Diff line change
1
+ class A :
2
+ class B (val b : Int )
3
+
4
+ object O :
5
+ val o : A | (Int => Int ) = (x : Int ) => x + 1
6
+ o match
7
+ case a : A => new a.B (10 )
8
+ case f : (_ => _) => f.asInstanceOf [Int => Int ](5 )
9
+
Original file line number Diff line number Diff line change
1
+ class A :
2
+ var x : Int = 10
3
+
4
+ object O :
5
+ val o : A | (Int => Int ) = (x : Int ) => x + 1
6
+ o match
7
+ case a : A => a.x = 20
8
+ case f : (_ => _) => f.asInstanceOf [Int => Int ](5 )
Original file line number Diff line number Diff line change
1
+ class A :
2
+ var x : Int = 10
3
+
4
+ object O :
5
+ val o : A | Array [Int ] = new Array [Int ](10 )
6
+ o match
7
+ case a : A => a.x = 20
8
+ case arr : Array [Int ] => arr(5 )
9
+
You can’t perform that action at this time.
0 commit comments