diff --git a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala index b8f78dfd9353..18dd6a5586db 100644 --- a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala +++ b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala @@ -1012,12 +1012,12 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] => else cpy.PackageDef(tree)(pid, slicedStats) :: Nil case tdef: TypeDef => val sym = tdef.symbol - assert(sym.isClass || ctx.tolerateErrorsForBestEffort) + assert(sym.isClass || ctx.tolerateErrorsForBestEffort || ctx.mode.is(Mode.ReadPositions)) if (cls == sym || cls == sym.linkedClass) tdef :: Nil else Nil case vdef: ValDef => val sym = vdef.symbol - assert(sym.is(Module) || ctx.tolerateErrorsForBestEffort) + assert(sym.is(Module) || ctx.tolerateErrorsForBestEffort || ctx.mode.is(Mode.ReadPositions)) if (cls == sym.companionClass || cls == sym.moduleClass) vdef :: Nil else Nil case tree => diff --git a/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala b/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala index 051b4d8f3b5b..0a618717a361 100644 --- a/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala +++ b/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala @@ -113,7 +113,7 @@ object CheckCaptures: if refSym.isType && !refSym.info.derivesFrom(defn.Caps_CapSet) then report.error(em"$elem is not a legal element of a capture set", ann.srcPos) case ref: CoreCapability => - if !ref.isTrackableRef && !ref.isCapRef then + if !ref.isTrackableRef && !ref.isCapRef && !ctx.mode.is(Mode.ReadPositions) then report.error(em"$elem cannot be tracked since it is not a parameter or local value", ann.srcPos) case ReachCapability(ref) => check(ref) diff --git a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala index 3b198ea4dbaa..3ef50b8fa423 100644 --- a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala @@ -2053,7 +2053,7 @@ object SymDenotations { case p :: parents1 => p.classSymbol match { case pcls: ClassSymbol => builder.addAll(pcls.baseClasses) - case _ => assert(isRefinementClass || p.isError || ctx.mode.is(Mode.Interactive) || ctx.tolerateErrorsForBestEffort, s"$this has non-class parent: $p") + case _ => assert(isRefinementClass || p.isError || ctx.mode.is(Mode.Interactive) || ctx.tolerateErrorsForBestEffort || ctx.mode.is(Mode.ReadPositions), s"$this has non-class parent: $p") } traverse(parents1) case nil => diff --git a/compiler/src/dotty/tools/dotc/typer/Checking.scala b/compiler/src/dotty/tools/dotc/typer/Checking.scala index 8573127d6f27..9bf02c35c8a1 100644 --- a/compiler/src/dotty/tools/dotc/typer/Checking.scala +++ b/compiler/src/dotty/tools/dotc/typer/Checking.scala @@ -1687,7 +1687,7 @@ trait Checking { val tname = sym.targetName if tname != sym.name then val preExisting = ctx.effectiveScope.lookup(tname) - if preExisting.exists || seen.contains(tname) then + if (preExisting.exists || seen.contains(tname)) && !ctx.mode.is(Mode.ReadPositions) then report.error(em"@targetName annotation ${'"'}$tname${'"'} clashes with other definition in same scope", stat.srcPos) if stat.isDef then seen += tname diff --git a/compiler/src/dotty/tools/dotc/typer/Implicits.scala b/compiler/src/dotty/tools/dotc/typer/Implicits.scala index 8b4e00a11d35..43e1068e3876 100644 --- a/compiler/src/dotty/tools/dotc/typer/Implicits.scala +++ b/compiler/src/dotty/tools/dotc/typer/Implicits.scala @@ -1098,7 +1098,7 @@ trait Implicits: def inferImplicit(pt: Type, argument: Tree, span: Span, ignored: Set[Symbol] = Set.empty)(using Context): SearchResult = ctx.profiler.onImplicitSearch(pt): trace(s"search implicit ${pt.show}, arg = ${argument.show}: ${argument.tpe.show}", implicits, show = true) { record("inferImplicit") - assert(ctx.phase.allowsImplicitSearch, + assert(ctx.phase.allowsImplicitSearch || ctx.mode.is(Mode.ReadPositions), if (argument.isEmpty) i"missing implicit parameter of type $pt after typer at phase ${ctx.phase}" else i"type error: ${argument.tpe} does not conform to $pt${err.whyNoMatchStr(argument.tpe, pt)}") diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 4b54419bd7a2..26251d153a3e 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -3287,7 +3287,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer selfType.member(decl.name).symbol.filter(other => other.isClass && other.owner != cls) decls.iterator.filter(_.isType).foldLeft(false) { (foundRedef, decl) => val other = memberInSelfButNotThis(decl) - if (other.exists) { + if (other.exists && !ctx.mode.is(Mode.ReadPositions)) { val msg = CannotHaveSameNameAs(decl, other, CannotHaveSameNameAs.DefinedInSelf(self)) report.error(msg, decl.srcPos) } diff --git a/project/Build.scala b/project/Build.scala index 6a29849c3c98..0439bd4aa451 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -448,11 +448,6 @@ object Build { ) ++ extMap } - val enableBspAllProjects = sys.env.get("ENABLE_BSP_ALL_PROJECTS").map(_.toBoolean).getOrElse{ - val enableBspAllProjectsFile = file(".enable_bsp_all_projects") - enableBspAllProjectsFile.exists() - } - // Setups up doc / scalaInstance to use in the bootstrapped projects instead of the default one lazy val scaladocDerivedInstanceSettings = Def.settings( // We cannot include scaladoc in the regular `scalaInstance` task because @@ -1312,7 +1307,6 @@ object Build { lazy val `scala-library-bootstrapped` = project.in(file("library")) .enablePlugins(ScalaLibraryPlugin) .settings(publishSettings) - .settings(disableDocSetting) // TODO now produces empty JAR to satisfy Sonatype, see https://github.com/scala/scala3/issues/24434 .settings( name := "scala-library-bootstrapped", moduleName := "scala-library",