File tree 3 files changed +18
-6
lines changed
compiler/src/dotty/tools/dotc/core
tasty/test/dotty/tools/tasty 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -1038,17 +1038,15 @@ object Types {
1038
1038
TypeComparer .isSameTypeWhenFrozen(this , that)
1039
1039
1040
1040
/** Is this type a primitive value type which can be widened to the primitive value type `that`? */
1041
- def isValueSubType (that : Type )(using Context ): Boolean = widen match {
1041
+ def isValueSubType (that : Type )(using Context ): Boolean = widenDealias match
1042
1042
case self : TypeRef if self.symbol.isPrimitiveValueClass =>
1043
- that.widenExpr match {
1043
+ that.widenExpr.dealias match
1044
1044
case that : TypeRef if that.symbol.isPrimitiveValueClass =>
1045
1045
defn.isValueSubClass(self.symbol, that.symbol)
1046
1046
case _ =>
1047
1047
false
1048
- }
1049
1048
case _ =>
1050
1049
false
1051
- }
1052
1050
1053
1051
def relaxed_<:< (that : Type )(using Context ): Boolean =
1054
1052
(this <:< that) || (this isValueSubType that)
Original file line number Diff line number Diff line change @@ -57,8 +57,8 @@ object TastyHeaderUnpicklerTest {
57
57
buf.writeNat(exp)
58
58
buf.writeNat(compilerBytes.length)
59
59
buf.writeBytes(compilerBytes, compilerBytes.length)
60
- buf.writeUncompressedLong(237478l )
61
- buf.writeUncompressedLong(324789l )
60
+ buf.writeUncompressedLong(237478L )
61
+ buf.writeUncompressedLong(324789L )
62
62
buf
63
63
}
64
64
Original file line number Diff line number Diff line change
1
+ object OK {
2
+ def apply (n : Int ): Unit = ()
3
+ def apply (n : Long ): Unit = ()
4
+ apply(3 ) // ok
5
+ apply(3L ) // ok
6
+ }
7
+
8
+ object KO {
9
+ type Key = Int
10
+ def apply (n : Key ): Unit = ()
11
+ def apply (n : Long ): Unit = ()
12
+ apply(3 ) // error
13
+ apply(3L ) // ok
14
+ }
You can’t perform that action at this time.
0 commit comments