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 @@ -243,13 +243,21 @@ object Types extends TypeUtils {
243243 def isExactlyNothing (using Context ): Boolean = this match {
244244 case tp : TypeRef =>
245245 tp.name == tpnme.Nothing && (tp.symbol eq defn.NothingClass )
246+ case AndType (tp1, tp2) =>
247+ tp1.isExactlyNothing || tp2.isExactlyNothing
248+ case OrType (tp1, tp2) =>
249+ tp1.isExactlyNothing && tp2.isExactlyNothing
246250 case _ => false
247251 }
248252
249253 /** Is this type exactly Any (no vars, aliases, refinements etc allowed)? */
250254 def isExactlyAny (using Context ): Boolean = this match {
251255 case tp : TypeRef =>
252256 tp.name == tpnme.Any && (tp.symbol eq defn.AnyClass )
257+ case AndType (tp1, tp2) =>
258+ tp1.isExactlyAny && tp2.isExactlyAny
259+ case OrType (tp1, tp2) =>
260+ tp1.isExactlyAny || tp2.isExactlyAny
253261 case _ => false
254262 }
255263
You can’t perform that action at this time.
0 commit comments