File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -244,13 +244,21 @@ object Types extends TypeUtils {
244
244
def isExactlyNothing (using Context ): Boolean = this match {
245
245
case tp : TypeRef =>
246
246
tp.name == tpnme.Nothing && (tp.symbol eq defn.NothingClass )
247
+ case AndType (tp1, tp2) =>
248
+ tp1.isExactlyNothing || tp2.isExactlyNothing
249
+ case OrType (tp1, tp2) =>
250
+ tp1.isExactlyNothing && tp2.isExactlyNothing
247
251
case _ => false
248
252
}
249
253
250
254
/** Is this type exactly Any (no vars, aliases, refinements etc allowed)? */
251
255
def isExactlyAny (using Context ): Boolean = this match {
252
256
case tp : TypeRef =>
253
257
tp.name == tpnme.Any && (tp.symbol eq defn.AnyClass )
258
+ case AndType (tp1, tp2) =>
259
+ tp1.isExactlyAny && tp2.isExactlyAny
260
+ case OrType (tp1, tp2) =>
261
+ tp1.isExactlyAny || tp2.isExactlyAny
254
262
case _ => false
255
263
}
256
264
You can’t perform that action at this time.
0 commit comments