File tree 3 files changed +7
-1
lines changed
compiler/src/dotty/tools/dotc/typer
3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -282,7 +282,7 @@ trait TypeAssigner {
282
282
val tp = tree.name match {
283
283
case p.arrayApply => MethodType (defn.IntType :: Nil , arrayElemType)
284
284
case p.arrayUpdate => MethodType (defn.IntType :: arrayElemType :: Nil , defn.UnitType )
285
- case p.arrayLength => MethodType (Nil , defn.IntType )
285
+ case p.arrayLength => arrayElemType; MethodType (Nil , defn.IntType )
286
286
287
287
// Note that we do not need to handle calls to Array[T]#clone() specially:
288
288
// The JLS section 10.7 says "The return type of the clone method of an array type
Original file line number Diff line number Diff line change
1
+ class Foo [U ] { self : Array [U ] & Nothing =>
2
+ self(0 ) = ??? // error: Array type conflict with Foo
3
+ }
Original file line number Diff line number Diff line change
1
+ class Foo [U ] { self : Array [U ] & Nothing =>
2
+ self.length // error: Array type conflict with Foo
3
+ }
You can’t perform that action at this time.
0 commit comments