We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 66f8213 + 2fa9003 commit e1f2505Copy full SHA for e1f2505
compiler/src/dotty/tools/dotc/core/Types.scala
@@ -244,13 +244,21 @@ object Types extends TypeUtils {
244
def isExactlyNothing(using Context): Boolean = this match {
245
case tp: TypeRef =>
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
251
case _ => false
252
}
253
254
/** Is this type exactly Any (no vars, aliases, refinements etc allowed)? */
255
def isExactlyAny(using Context): Boolean = this match {
256
257
tp.name == tpnme.Any && (tp.symbol eq defn.AnyClass)
258
259
+ tp1.isExactlyAny && tp2.isExactlyAny
260
261
+ tp1.isExactlyAny || tp2.isExactlyAny
262
263
264
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments