Skip to content

Commit 030e867

Browse files
committed
Use isProvisional helper method
... to avoid proliferation of flagsUNSAFE
1 parent 0666fec commit 030e867

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,9 @@ object SymDenotations {
658658
containsOpaques ||
659659
is(Module, butNot = Package) && owner.seesOpaques
660660

661+
def isProvisional(using Context): Boolean =
662+
flagsUNSAFE.is(Provisional) // do not force the info to check the flag
663+
661664
/** Is this the denotation of a self symbol of some class?
662665
* This is the case if one of two conditions holds:
663666
* 1. It is the symbol referred to in the selfInfo part of the ClassInfo

compiler/src/dotty/tools/dotc/core/TypeApplications.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ class TypeApplications(val self: Type) extends AnyVal {
285285
/** Dealias type if it can be done without forcing the TypeRef's info */
286286
def safeDealias(using Context): Type = self match {
287287
case self: TypeRef
288-
if self.denot.exists && self.symbol.isAliasType && !self.symbol.flagsUNSAFE.is(Provisional) =>
288+
if self.denot.exists && self.symbol.isAliasType && !self.symbol.isProvisional =>
289289
self.superType.stripTypeVar.safeDealias
290290
case _ =>
291291
self

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ object Types {
118118
case t: TypeRef =>
119119
!t.currentSymbol.isStatic && {
120120
(t: Type).mightBeProvisional = false // break cycles
121-
t.symbol.flagsUNSAFE.is(Provisional)
121+
t.symbol.isProvisional
122122
|| test(t.prefix, theAcc)
123123
|| t.denot.infoOrCompleter.match
124124
case info: LazyType => true

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2030,7 +2030,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
20302030
if tycon == defn.andType || tycon == defn.orType then
20312031
checkedArgs = checkedArgs.mapconserve(arg =>
20322032
checkSimpleKinded(checkNoWildcard(arg)))
2033-
else if tycon.flagsUNSAFE.is(Provisional) then
2033+
else if tycon.isProvisional then
20342034
// A type with Provisional flag is either an alias or abstract type.
20352035
// If it is an alias type, it would mean the type is cyclic
20362036
// If it is an abstract type, it would mean the type is an irreducible

0 commit comments

Comments
 (0)