diff --git a/compiler/src/dotty/tools/dotc/core/Denotations.scala b/compiler/src/dotty/tools/dotc/core/Denotations.scala index 5787a284d6d4..e33a664c1ee7 100644 --- a/compiler/src/dotty/tools/dotc/core/Denotations.scala +++ b/compiler/src/dotty/tools/dotc/core/Denotations.scala @@ -1074,7 +1074,7 @@ object Denotations { def filterDisjoint(denots: PreDenotation)(using Context): SingleDenotation = if (denots.exists && denots.matches(this)) NoDenotation else this def filterWithFlags(required: FlagSet, excluded: FlagSet)(using Context): SingleDenotation = - val realExcluded = if ctx.isAfterTyper then excluded else excluded | Invisible | (if ctx.mode.is(Mode.ResolveFromTASTy) then EmptyFlags else SourceInvisible) + val realExcluded = if ctx.isAfterTyper then excluded else excluded | (if ctx.mode.is(Mode.ResolveFromTASTy) then EmptyFlags else Invisible) def symd: SymDenotation = this match case symd: SymDenotation => symd case _ => symbol.denot diff --git a/compiler/src/dotty/tools/dotc/core/Flags.scala b/compiler/src/dotty/tools/dotc/core/Flags.scala index 9939032df916..b915373da021 100644 --- a/compiler/src/dotty/tools/dotc/core/Flags.scala +++ b/compiler/src/dotty/tools/dotc/core/Flags.scala @@ -380,9 +380,6 @@ object Flags { /** Tracked modifier for class parameter / a class with some tracked parameters */ val (Tracked @ _, _, Dependent @ _) = newFlags(46, "tracked") - /** Symbol can not be resolved from source during typer. PROVISIONAL (possibly replace with `Invisible` with new semantics) */ - val (SourceInvisible @ _, _, _) = newFlags(47, "") - // ------------ Flags following this one are not pickled ---------------------------------- /** Symbol is not a member of its owner */ @@ -474,7 +471,7 @@ object Flags { Scala2SpecialFlags, MutableOrOpen, Opaque, Touched, JavaStatic, OuterOrCovariant, LabelOrContravariant, CaseAccessor, Tracked, Extension, NonMember, Implicit, Given, Permanent, Synthetic, Exported, - SuperParamAliasOrScala2x, Inline, Macro, ConstructorProxy, Invisible, SourceInvisible) + SuperParamAliasOrScala2x, Inline, Macro, ConstructorProxy, Invisible) /** Flags that are not (re)set when completing the denotation, or, if symbol is * a top-level class or object, when completing the denotation once the class @@ -528,7 +525,7 @@ object Flags { val RetainedModuleValAndClassFlags: FlagSet = AccessFlags | Package | Case | Synthetic | JavaDefined | JavaStatic | Artifact | - Lifted | MixedIn | Specialized | ConstructorProxy | Invisible | SourceInvisible | Erased + Lifted | MixedIn | Specialized | ConstructorProxy | Invisible | Erased /** Flags that can apply to a module val */ val RetainedModuleValFlags: FlagSet = RetainedModuleValAndClassFlags | diff --git a/compiler/src/dotty/tools/dotc/core/NamerOps.scala b/compiler/src/dotty/tools/dotc/core/NamerOps.scala index c1962d9fc557..363a01665564 100644 --- a/compiler/src/dotty/tools/dotc/core/NamerOps.scala +++ b/compiler/src/dotty/tools/dotc/core/NamerOps.scala @@ -110,7 +110,7 @@ object NamerOps: else NoSymbol.assertingErrorsReported(em"no companion $name in $scope") /** If a class has one of these flags, it does not get a constructor companion */ - private val NoConstructorProxyNeededFlags = Abstract | Trait | Case | Synthetic | Module | Invisible | SourceInvisible + private val NoConstructorProxyNeededFlags = Abstract | Trait | Case | Synthetic | Module | Invisible /** The flags of a constructor companion */ private val ConstructorCompanionFlags = Synthetic | ConstructorProxy diff --git a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala index 4fbfd292f7c6..f5b47510b507 100644 --- a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala @@ -617,7 +617,7 @@ object SymDenotations { case _ => // Otherwise, no completion is necessary, see the preconditions of `markAbsent()`. (myInfo `eq` NoType) - || (is(Invisible) || is(SourceInvisible) && !ctx.mode.is(Mode.ResolveFromTASTy)) && ctx.isTyper + || (is(Invisible) && !ctx.mode.is(Mode.ResolveFromTASTy)) && ctx.isTyper || is(ModuleVal, butNot = Package) && moduleClass.isAbsent(canForce) } diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala index f06da2dca71b..326471d8071c 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala @@ -881,7 +881,6 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) { if flags.is(Transparent) then writeModTag(TRANSPARENT) if flags.is(Infix) then writeModTag(INFIX) if flags.is(Invisible) then writeModTag(INVISIBLE) - if flags.is(SourceInvisible) then writeModTag(SOURCEINVISIBLE) if (flags.is(Erased)) writeModTag(ERASED) if (flags.is(Exported)) writeModTag(EXPORTED) if (flags.is(Given)) writeModTag(GIVEN) diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index 74e5ef08b874..e7fd3fabe82e 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -756,7 +756,6 @@ class TreeUnpickler(reader: TastyReader, case EXPORTED => addFlag(Exported) case OPEN => addFlag(Open) case INVISIBLE => addFlag(Invisible) - case SOURCEINVISIBLE => addFlag(SourceInvisible) case TRANSPARENT => addFlag(Transparent) case INFIX => addFlag(Infix) case TRACKED => addFlag(Tracked) @@ -1583,7 +1582,7 @@ class TreeUnpickler(reader: TastyReader, (if !d.exists then lookupInSuper else d).asSeenFrom(prefix) val denot = inContext(ctx.addMode(Mode.ResolveFromTASTy)): - searchDenot // able to resolve SourceInvisible members + searchDenot // able to resolve Invisible members val sel = makeSelect(qual, name, denot) diff --git a/compiler/src/dotty/tools/dotc/transform/UnrollDefinitions.scala b/compiler/src/dotty/tools/dotc/transform/UnrollDefinitions.scala index e36a5e875787..9cbaf7738533 100644 --- a/compiler/src/dotty/tools/dotc/transform/UnrollDefinitions.scala +++ b/compiler/src/dotty/tools/dotc/transform/UnrollDefinitions.scala @@ -26,7 +26,7 @@ import dotty.tools.unreachable /**Implementation of SIP-61. * Runs when `@unroll` annotations are found in a compilation unit, installing new definitions * - * Note that it only generates `SourceInvisible` methods, so no interactions with Zinc/SemanticDB + * Note that it only generates `Invisible` methods, so no interactions with Zinc/SemanticDB */ class UnrollDefinitions extends MacroTransform, IdentityDenotTransformer { self => @@ -127,7 +127,7 @@ class UnrollDefinitions extends MacroTransform, IdentityDenotTransformer { defdef.symbol.owner, defdef.name, defdef.symbol.flags &~ HasDefaultParams | - SourceInvisible | Synthetic, + Invisible | Synthetic, NoType, // fill in later coord = nextSymbol.span.shift(1) // shift by 1 to avoid "secondary constructor must call preceding" error ).entered diff --git a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala index 3029ae0cc43a..ce8d19aae46a 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -2955,7 +2955,6 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler def Infix: Flags = dotc.core.Flags.Infix def Inline: Flags = dotc.core.Flags.Inline def Invisible: Flags = dotc.core.Flags.Invisible - def SourceInvisible: Flags = dotc.core.Flags.SourceInvisible def JavaDefined: Flags = dotc.core.Flags.JavaDefined def JavaStatic: Flags = dotc.core.Flags.JavaStatic def JavaAnnotation: Flags = dotc.core.Flags.JavaAnnotation diff --git a/library/src/scala/quoted/Quotes.scala b/library/src/scala/quoted/Quotes.scala index 21879f45ba7f..fad769793bb7 100644 --- a/library/src/scala/quoted/Quotes.scala +++ b/library/src/scala/quoted/Quotes.scala @@ -4588,10 +4588,6 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => /** Is this symbol invisible when typechecking? */ def Invisible: Flags - /** Is this symbol invisible when typechecking? (only from source) */ - @experimental - def SourceInvisible: Flags - /** Is this symbol defined in a Java class */ def JavaDefined: Flags diff --git a/tasty/src/dotty/tools/tasty/TastyFormat.scala b/tasty/src/dotty/tools/tasty/TastyFormat.scala index 02291e27aca4..603148d635aa 100644 --- a/tasty/src/dotty/tools/tasty/TastyFormat.scala +++ b/tasty/src/dotty/tools/tasty/TastyFormat.scala @@ -227,8 +227,7 @@ Standard-Section: "ASTs" TopLevelStat* PARAMalias -- Parameter is alias of a superclass parameter EXPORTED -- An export forwarder OPEN -- an open class - INVISIBLE -- invisible during typechecking - SOURCEINVISIBLE -- invisible in the source code + INVISIBLE -- invisible during typechecking, except when resolving from TASTy TRACKED -- a tracked class parameter / a dependent class Annotation @@ -512,7 +511,6 @@ object TastyFormat { final val EMPTYCLAUSE = 45 final val SPLITCLAUSE = 46 final val TRACKED = 47 - final val SOURCEINVISIBLE = 48 // Tree Cat. 2: tag Nat final val firstNatTreeTag = SHAREDterm @@ -702,7 +700,6 @@ object TastyFormat { | EXPORTED | OPEN | INVISIBLE - | SOURCEINVISIBLE | ANNOTATION | PRIVATEqualified | PROTECTEDqualified @@ -767,7 +764,6 @@ object TastyFormat { case EXPORTED => "EXPORTED" case OPEN => "OPEN" case INVISIBLE => "INVISIBLE" - case SOURCEINVISIBLE => "SOURCEINVISIBLE" case PARAMalias => "PARAMalias" case EMPTYCLAUSE => "EMPTYCLAUSE" case SPLITCLAUSE => "SPLITCLAUSE" diff --git a/tests/run-tasty-inspector/stdlibExperimentalDefinitions.scala b/tests/run-tasty-inspector/stdlibExperimentalDefinitions.scala index 9c9ea196cb8f..46be0fcb1901 100644 --- a/tests/run-tasty-inspector/stdlibExperimentalDefinitions.scala +++ b/tests/run-tasty-inspector/stdlibExperimentalDefinitions.scala @@ -87,7 +87,7 @@ val experimentalDefinitionInLibrary = Set( "scala.Predef$.runtimeChecked", "scala.annotation.internal.RuntimeChecked", // New feature: SIP 61 - @unroll annotation - "scala.annotation.unroll", "scala.quoted.Quotes.reflectModule.FlagsModule.SourceInvisible" + "scala.annotation.unroll" )