Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf6c0c59

Browse files
committed
Use -Xsource:3 and accommodate signature moves
1 parentff5c154 commitf6c0c59

File tree

38 files changed

+128
-91
lines changed

38 files changed

+128
-91
lines changed

‎build.sbt

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,15 @@ lazy val commonSettings = instanceSettings ++ clearSourceAndResourceDirectories
196196
cleanFiles+= (Compile/ doc/ target).value,
197197
run/ fork:=true,
198198
run/ connectInput:=true,
199-
Compile/ scalacOptions++=Seq("-feature","-Xlint",
199+
Compile/ scalacOptions++=Seq("-Xlint","-feature","-Xsource:3-cross",
200200
//"-Vprint",
201201
//"-Xmaxerrs", "5", "-Xmaxwarns", "5", // uncomment for ease of development while breaking things
202202
// work around https://github.com/scala/bug/issues/11534
203203
"-Wconf:cat=unchecked&msg=The outer reference in this type test cannot be checked at run time.:s",
204204
// optimizer warnings at INFO since `-Werror` may be turned on.
205205
// optimizer runs in CI and release builds, though not in local development.
206-
"-Wconf:cat=optimizer:is",
206+
//"-Wconf:cat=optimizer:is",
207+
"-Wopt",
207208
// we use @nowarn for methods that are deprecated in JDK > 8, but CI/release is under JDK 8
208209
"-Wconf:cat=unused-nowarn:s",
209210
"-Wunnamed-boolean-literal-strict",
@@ -450,6 +451,10 @@ lazy val library = configureAsSubproject(project)
450451
name:="scala-library",
451452
description:="Scala Standard Library",
452453
Compile/ scalacOptions++=Seq("-sourcepath", (Compile/ scalaSource).value.toString),
454+
Compile/ scalacOptions++=Seq("-Xsource-features:-case-companion-function"),
455+
Compile/ scalacOptions++=Seq("-Wconf:cat=scala3-migration&msg=elidable&site=scala.Predef:s"),
456+
//Compile / scalacOptions ++= Seq("-Wconf:msg=Synthetic case companion&src=src/library/scala/jdk/FunctionWrappers.scala:s"),
457+
//Compile / scalacOptions ++= Seq("-Wconf:cat=scala3-migration&msg=constructor modifiers&site=scala.concurrent.duration.Deadline:s"), // for bootstrap until restarr
453458
Compile/ doc/ scalacOptions++= {
454459
vallibraryAuxDir= (ThisBuild/ baseDirectory).value/"src/library-aux"
455460
Seq(
@@ -502,6 +507,7 @@ lazy val reflect = configureAsSubproject(project)
502507
Osgi.bundleName:="Scala Reflect",
503508
Compile/ scalacOptions++=Seq(
504509
"-Wconf:cat=deprecation&msg=early initializers:s",// compiler heavily relies upon early initializers
510+
"-Wconf:cat=scala3-migration&msg=early initializers:s",// compiler heavily relies upon early initializers
505511
),
506512
Compile/ doc/ scalacOptions++=Seq(
507513
"-skip-packages","scala.reflect.macros.internal:scala.reflect.internal:scala.reflect.io"
@@ -576,6 +582,7 @@ lazy val compiler = configureAsSubproject(project)
576582
Compile/ scalacOptions++=Seq(
577583
//"-Wunused", //"-Wnonunit-statement",
578584
"-Wconf:cat=deprecation&msg=early initializers:s",// compiler heavily relies upon early initializers
585+
"-Wconf:cat=scala3-migration&msg=early initializers:s",// compiler heavily relies upon early initializers
579586
),
580587
Compile/ doc/ scalacOptions++=Seq(
581588
"-doc-root-content", (Compile/ sourceDirectory).value+"/rootdoc.txt"
@@ -614,15 +621,21 @@ lazy val interactive = configureAsSubproject(project)
614621
.settings(
615622
name:="scala-compiler-interactive",
616623
description:="Scala Interactive Compiler",
617-
Compile/ scalacOptions++=Seq("-Wconf:cat=deprecation&msg=early initializers:s"),
624+
Compile/ scalacOptions++=Seq(
625+
"-Wconf:cat=deprecation&msg=early initializers:s",
626+
"-Wconf:cat=scala3-migration&msg=early initializers:s",// compiler heavily relies upon early initializers
627+
)
618628
)
619629
.dependsOn(compiler)
620630

621631
lazyvalrepl= configureAsSubproject(project)
622632
.settings(disableDocs)
623633
.settings(fatalWarningsSettings)
624634
.settings(publish/ skip:=true)
625-
.settings(Compile/ scalacOptions++=Seq("-Wconf:cat=deprecation&msg=early initializers:s"))
635+
.settings(Compile/ scalacOptions++=Seq(
636+
"-Wconf:cat=deprecation&msg=early initializers:s",
637+
"-Wconf:cat=scala3-migration&msg=early initializers:s",
638+
))
626639
.dependsOn(compiler, interactive)
627640

628641
lazyvalreplFrontend= configureAsSubproject(project, srcdir=Some("repl-frontend"))
@@ -652,6 +665,7 @@ lazy val scaladoc = configureAsSubproject(project)
652665
Compile/ resourceGenerators+=ScaladocSettings.extractResourcesFromWebjar,
653666
Compile/ scalacOptions++=Seq(
654667
"-Wconf:cat=deprecation&msg=early initializers:s",
668+
"-Wconf:cat=scala3-migration&msg=early initializers:s",
655669
),
656670
)
657671
.dependsOn(compiler)
@@ -667,6 +681,7 @@ lazy val sbtBridge = configureAsSubproject(project, srcdir = Some("sbt-bridge"))
667681
libraryDependencies+= compilerInterfaceDep%Provided,
668682
Compile/ scalacOptions++=Seq(
669683
"-Wconf:cat=deprecation&msg=early initializers:s",// compiler heavily relies upon early initializers
684+
"-Wconf:cat=scala3-migration&msg=early initializers:s",// compiler heavily relies upon early initializers
670685
),
671686
generateServiceProviderResources("xsbti.compile.CompilerInterface2"->"scala.tools.xsbt.CompilerBridge"),
672687
generateServiceProviderResources("xsbti.compile.ConsoleInterface1"->"scala.tools.xsbt.ConsoleBridge"),
@@ -736,6 +751,7 @@ lazy val partest = configureAsSubproject(project)
736751
libraryDependencies++=List(testInterfaceDep, diffUtilsDep, junitDep),
737752
Compile/ scalacOptions++=Seq(
738753
"-Wconf:cat=deprecation&msg=early initializers:s",// compiler heavily relies upon early initializers
754+
"-Wconf:cat=scala3-migration&msg=early initializers:s",// compiler heavily relies upon early initializers
739755
),
740756
Compile/ javacOptions++=Seq("-XDenableSunApiLintControl","-Xlint")++
741757
(if (fatalWarnings.value)Seq("-Werror")elseSeq()),
@@ -808,8 +824,7 @@ lazy val bench = project.in(file("test") / "benchmarks")
808824
if (benchmarkScalaVersion=="")Nil
809825
else"org.scala-lang"%"scala-compiler"% benchmarkScalaVersion::Nil
810826
},
811-
//scalacOptions ++= Seq("-feature", "-opt:inline:scala/**", "-Wopt"),
812-
scalacOptions++=Seq("-feature","-opt:l:inline","-opt-inline-from:scala/**","-opt-warnings"),
827+
scalacOptions++=Seq("-feature","-opt:inline:scala/**","-Wopt"),
813828
// Skips JMH source generators during IDE import to avoid needing to compile scala-library during the import
814829
// should not be needed once sbt-jmh 0.4.3 is out (https://github.com/sbt/sbt-jmh/pull/207)
815830
Jmh/ bspEnabled:=false
@@ -856,6 +871,8 @@ lazy val junit = project.in(file("test") / "junit")
856871
"-Wconf:msg=match may not be exhaustive:s",// if we missed a case, all that happens is the test fails
857872
"-Wconf:cat=lint-nullary-unit&site=.*Test:s",// normal unit test style
858873
"-Ypatmat-exhaust-depth","40",// despite not caring about patmat exhaustiveness, we still get warnings for this
874+
"-Wconf:cat=deprecation&msg=early initializers:s",
875+
"-Wconf:cat=scala3-migration&msg=early initializers:s",
859876
),
860877
Compile/ javacOptions++=Seq("-Xlint"),
861878
libraryDependencies++=Seq(junitInterfaceDep, jolDep, diffUtilsDep, compilerInterfaceDep),

‎project/ScriptCommands.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ object ScriptCommands {
161161
}
162162

163163
private[this]valenableOptimizer=Seq(
164-
//ThisBuild / Compile / scalacOptions ++= Seq("-opt:inline:scala/**")
165-
ThisBuild/Compile/ scalacOptions++=Seq("-opt:l:inline","-opt-inline-from:scala/**")
164+
ThisBuild/Compile/ scalacOptions++=Seq("-opt:inline:scala/**")
166165
)
167166

168167
valnoDocs=Seq(

‎src/compiler/scala/tools/nsc/GenericRunnerSettings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ class GenericRunnerSettings(error: String => Unit, pathFactory: PathFactory) ext
6565
"-nc",
6666
"do not use the legacy fsc compilation daemon").withAbbreviation("-nocompdaemon").withAbbreviation("--no-compilation-daemon")
6767
.withDeprecationMessage("scripts use cold compilation by default; use -Yscriptrunner for custom behavior")
68-
.withPostSetHook {x:BooleanSetting=>Yscriptrunner.value=if (x.value)"default"else"resident" }
68+
.withPostSetHook {(x:BooleanSetting)=>Yscriptrunner.value=if (x.value)"default"else"resident" }
6969
}

‎src/compiler/scala/tools/nsc/PipelineMain.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class PipelineMainClass(argFiles: Seq[Path], pipelineSettings: PipelineMain.Pipe
201201
}
202202
strategymatch {
203203
caseOutlineTypePipeline=>
204-
projects.foreach {p:Task=>
204+
projects.foreach {(p:Task)=>
205205
valdepsReady=Future.traverse(dependsOn.getOrElse(p,Nil))(task=> p.dependencyReadyFuture(task))
206206
valf=for {
207207
_<- depsReady

‎src/compiler/scala/tools/nsc/Reporting.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -825,15 +825,15 @@ object Reporting {
825825
if (s=="any") {
826826
Right(Any)
827827
}elseif (s.startsWith("msg=")) {
828-
regex(s.substring(4)).map(MessagePattern)
828+
regex(s.substring(4)).map(MessagePattern(_))
829829
}elseif (s.startsWith("cat=")) {
830830
valcs= s.substring(4)
831-
valc=WarningCategory.all.get(cs).map(Category)
831+
valc=WarningCategory.all.get(cs).map(Category(_))
832832
c.toRight(s"Unknown category: `$cs`")
833833
}elseif (s.startsWith("site=")) {
834-
regex(s.substring(5)).map(SitePattern)
834+
regex(s.substring(5)).map(SitePattern(_))
835835
}elseif (s.startsWith("origin=")) {
836-
regex(s.substring(7)).map(DeprecatedOrigin)
836+
regex(s.substring(7)).map(DeprecatedOrigin(_))
837837
}elseif (s.startsWith("since")) {
838838
deffail=Left(s"invalid since filter: `$s`; required shape: `since<1.2.3`, `since=3.2`, `since>2`")
839839
if (s.length<6) fail
@@ -860,7 +860,7 @@ object Reporting {
860860
if (!rootDir.endsWith("/")&&!arg.startsWith("/")) pat+='/'
861861
pat++= arg
862862
if (!arg.endsWith("$")) pat+='$'
863-
regex(pat.toString).map(SourcePattern)
863+
regex(pat.toString).map(SourcePattern(_))
864864
}else {
865865
Left(s"unknown filter:$s")
866866
}

‎src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ abstract class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
3333
importcodeGen.CodeGenImpl._
3434
importpostProcessor.{bTypesFromClassfile,byteCodeRepository}
3535

36-
valcoreBTypes=newCoreBTypesFromSymbols[G] {
36+
valcoreBTypes:CoreBTypesFromSymbols[G] {valbTypes:BTypesFromSymbols.this.type}=newCoreBTypesFromSymbols[G] {
3737
valbTypes:BTypesFromSymbols.this.type=BTypesFromSymbols.this
3838
}
3939
importcoreBTypes._

‎src/compiler/scala/tools/nsc/backend/jvm/ClassfileWriters.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ abstract class ClassfileWriters {
8282
if (distinctOutputs.size==1)newSingleClassWriter(FileWriter(global, distinctOutputs.head, jarManifestMainClass))
8383
else {
8484
valsourceToOutput:Map[AbstractFile,AbstractFile]= global.currentRun.units.map(unit=> (unit.source.file, frontendAccess.compilerSettings.outputDirectory(unit.source.file))).toMap
85-
newMultiClassWriter(sourceToOutput, distinctOutputs.iterator.map {output:AbstractFile=> output->FileWriter(global, output, jarManifestMainClass) }.toMap)
85+
newMultiClassWriter(sourceToOutput, distinctOutputs.iterator.map {(output:AbstractFile)=> output->FileWriter(global, output, jarManifestMainClass) }.toMap)
8686
}
8787
}
8888

‎src/compiler/scala/tools/nsc/classpath/DirectoryClassPath.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ final class CtSymClassPath(ctSym: java.nio.file.Path, release: Int) extends Clas
329329
}
330330

331331
caseclassDirectoryClassPath(dir:File)extendsJFileDirectoryLookup[ClassFileEntryImpl]withNoSourcePaths {
332-
overridedeffindClass(className:String):Option[ClassRepresentation]= findClassFile(className)mapClassFileEntryImpl
332+
overridedeffindClass(className:String):Option[ClassRepresentation]= findClassFile(className).map(ClassFileEntryImpl(_))
333333

334334
deffindClassFile(className:String):Option[AbstractFile]= {
335335
valrelativePath=FileUtils.dirPath(className)
@@ -354,7 +354,7 @@ case class DirectorySourcePath(dir: File) extends JFileDirectoryLookup[SourceFil
354354
protecteddefcreateFileEntry(file:AbstractFile):SourceFileEntryImpl=SourceFileEntryImpl(file)
355355
protecteddefisMatchingFile(f:File,siblingExists:String=>Boolean):Boolean= endsScalaOrJava(f.getName)
356356

357-
overridedeffindClass(className:String):Option[ClassRepresentation]= findSourceFile(className)mapSourceFileEntryImpl
357+
overridedeffindClass(className:String):Option[ClassRepresentation]= findSourceFile(className).map(SourceFileEntryImpl(_))
358358

359359
privatedeffindSourceFile(className:String):Option[AbstractFile]= {
360360
valrelativePath=FileUtils.dirPath(className)

‎src/compiler/scala/tools/nsc/classpath/VirtualDirectoryClassPath.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ case class VirtualDirectoryClassPath(dir: VirtualDirectory) extends ClassPath wi
3939
// mimic the behavior of the old nsc.util.DirectoryClassPath
4040
defasURLs:Seq[URL]=Seq(newURI("file://_VIRTUAL_/"+ dir.name).toURL)
4141
defasClassPathStrings:Seq[String]=Seq(dir.path)
42-
overridedeffindClass(className:String):Option[ClassRepresentation]= findClassFile(className)mapClassFileEntryImpl
42+
overridedeffindClass(className:String):Option[ClassRepresentation]= findClassFile(className).map(ClassFileEntryImpl(_))
4343

4444
deffindClassFile(className:String):Option[AbstractFile]= {
4545
valrelativePath=FileUtils.dirPath(className)+".class"

‎src/compiler/scala/tools/nsc/tasty/bridge/TreeOps.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
* additional information regarding copyright ownership.
1111
*/
1212

13-
packagescala.tools.nsc.tasty.bridge
13+
packagescala.tools.nsc.tasty
14+
packagebridge
1415

15-
importscala.tools.nsc.tasty.{TastyUniverse,TastyModes},TastyModes._
16+
importTastyModes._
1617

1718
importscala.tools.tasty.TastyName
1819
importscala.reflect.internal.Flags

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp