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 {
1112
1112
1113
1113
/** If `tree` is a complete application of a compiler-generated `apply`
1114
1114
* 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 .
1117
1117
* The underlying type is the intersection of all class parents of the
1118
1118
* orginal type.
1119
1119
*/
Original file line number Diff line number Diff line change @@ -39,9 +39,8 @@ enum OptInv[+T] {
39
39
println(t5) // true
40
40
println
41
41
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
45
44
println
46
45
47
46
val t6 = Sm (Person (" Test" , 23 )) === Sm (Person (" Test" , 23 ))
You can’t perform that action at this time.
0 commit comments