aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index 58a6d226d..05fb963f9 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -606,7 +606,7 @@ object Types {
}
/** Is this type a primitive value type which can be widened to the primitive value type `that`? */
- def isValueSubType(that: Type)(implicit ctx: Context) = widenExpr match {
+ def isValueSubType(that: Type)(implicit ctx: Context) = widen match {
case self: TypeRef if defn.ScalaValueClasses contains self.symbol =>
that.widenExpr match {
case that: TypeRef if defn.ScalaValueClasses contains that.symbol =>
@@ -618,6 +618,9 @@ object Types {
false
}
+ def relaxed_<:<(that: Type)(implicit ctx: Context) =
+ (this <:< that) || (this isValueSubType that)
+
/** Is this type a legal type for a member that overrides another
* member of type `that`? This is the same as `<:<`, except that
* the types ()T and => T are identified, and T is seen as overriding