Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/ast/TreeInfo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/SymDenotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Checking.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)}")

Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Typer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
6 changes: 0 additions & 6 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down
Loading