File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -1112,8 +1112,8 @@ trait Applications extends Compatibility {
11121112
11131113 /** If `tree` is a complete application of a compiler-generated `apply`
11141114 * or `copy` method of an enum case, widen its type to the underlying
1115- * type by means of a type ascription, unless the expected type is an
1116- * enum case itself .
1115+ * type by means of a type ascription, as long as the widened type is
1116+ * still compatible with the expected type .
11171117 * The underlying type is the intersection of all class parents of the
11181118 * orginal type.
11191119 */
Original file line number Diff line number Diff line change @@ -39,9 +39,8 @@ enum OptInv[+T] {
3939 println(t5) // true
4040 println
4141
42- // Here invariant case without explicit type parameter will instantiate T to OptInv[Any]
43- val t5_2 = OptInv .Sm [Int ](23 ) === OptInv .Sm (23 )
44- println(t5) // true
42+ val t5_2 = OptInv .Sm (23 ) === OptInv .Sm (23 )
43+ println(t5_2) // true
4544 println
4645
4746 val t6 = Sm (Person (" Test" , 23 )) === Sm (Person (" Test" , 23 ))
You can’t perform that action at this time.
0 commit comments