Skip to content

Commit c40c26b

Browse files
committed
Merge remote-tracking branch 'origin/2.13.x' into topic/unsafe-undead
2 parents 1825b6b + 0fd1b66 commit c40c26b

File tree

400 files changed

+5690
-2156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

400 files changed

+5690
-2156
lines changed

build.sbt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ lazy val commonSettings = instanceSettings ++ clearSourceAndResourceDirectories
157157
// END: Copy/pasted from SBT
158158
},
159159
fork in run := true,
160-
//scalacOptions += "-Xlint:-nullary-override,-inaccessible,_",
160+
scalacOptions in Compile += "-Xlint:-nullary-override,-inaccessible,-nonlocal-return,_",
161161
//scalacOptions ++= Seq("-Xmaxerrs", "5", "-Xmaxwarns", "5"),
162162
scalacOptions in Compile in doc ++= Seq(
163163
"-doc-footer", "epfl",
@@ -606,6 +606,7 @@ lazy val junit = project.in(file("test") / "junit")
606606
.dependsOn(library, reflect, compiler, partest, scaladoc)
607607
.settings(clearSourceAndResourceDirectories)
608608
.settings(commonSettings)
609+
.settings(scalacOptions in Compile += "-Xlint:-nullary-unit,-adapted-args")
609610
.settings(disableDocs)
610611
.settings(disablePublishing)
611612
.settings(
@@ -713,6 +714,7 @@ lazy val test = project
713714
.disablePlugins(plugins.JUnitXmlReportPlugin)
714715
.configs(IntegrationTest)
715716
.settings(commonSettings)
717+
.settings(scalacOptions in Compile -= "-Xlint:-nullary-override,-inaccessible,-nonlocal-return,_") // as in common settings
716718
.settings(disableDocs)
717719
.settings(disablePublishing)
718720
.settings(Defaults.itSettings)
@@ -724,6 +726,8 @@ lazy val test = project
724726
// test sources are compiled in partest run, not here
725727
sources in IntegrationTest := Seq.empty,
726728
fork in IntegrationTest := true,
729+
// enable this in 2.13, when tests pass
730+
//scalacOptions in Compile += "-Yvalidate-pos:parser,typer",
727731
javaOptions in IntegrationTest ++= List("-Xmx2G", "-Dpartest.exec.in.process=true", "-Dfile.encoding=UTF-8", "-Duser.language=en", "-Duser.country=US"),
728732
testOptions in IntegrationTest += Tests.Argument("-Dfile.encoding=UTF-8", "-Duser.language=en", "-Duser.country=US"),
729733
testFrameworks += new TestFramework("scala.tools.partest.sbt.Framework"),

project/ScalaOptionParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ object ScalaOptionParser {
9797
"-Ypresentation-log", "-Ypresentation-replay", "-Yrepl-outdir", "-d", "-dependencyfile", "-encoding", "-Xscript")
9898
private def pathSettingNames = List("-bootclasspath", "-classpath", "-extdirs", "-javabootclasspath", "-javaextdirs", "-sourcepath", "-toolcp")
9999
private val phases = List("all", "parser", "namer", "packageobjects", "typer", "patmat", "superaccessors", "extmethods", "pickler", "refchecks", "uncurry", "tailcalls", "specialize", "explicitouter", "erasure", "posterasure", "fields", "lambdalift", "constructors", "flatten", "mixin", "cleanup", "delambdafy", "icode", "jvm", "terminal")
100-
private val phaseSettings = List("-Xprint-icode", "-Ystop-after", "-Yskip", "-Yshow", "-Ystop-before", "-Ybrowse", "-Ylog", "-Ycheck", "-Xprint")
100+
private val phaseSettings = List("-Xprint-icode", "-Ystop-after", "-Yskip", "-Yshow", "-Ystop-before", "-Ybrowse", "-Ylog", "-Ycheck", "-Xprint", "-Yvalidate-pos")
101101
private def multiStringSettingNames = List("-Xmacro-settings", "-Xplugin", "-Xplugin-disable", "-Xplugin-require", "-Ywarn-unused")
102102
private def intSettingNames = List("-Xmax-classfile-name", "-Xelide-below", "-Ypatmat-exhaust-depth", "-Ypresentation-delay", "-Yrecursion")
103103
private def choiceSettingNames = Map[String, List[String]](

spec/11-annotations.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -149,26 +149,28 @@ Java platform, the following annotations have a standard meaning.
149149
Whenever the static type of an expression matches a specialized variant of
150150
a definition, the compiler will instead use the specialized version.
151151
See the [specialization sid](http://docs.scala-lang.org/sips/completed/scala-specialization.html) for more details of the implementation.
152+
152153

153154
## User-defined Annotations
154155

155-
Other annotations may be interpreted by platform- or
156-
application-dependent tools. Class `scala.Annotation` has two
157-
sub-traits which are used to indicate how these annotations are
158-
retained. Instances of an annotation class inheriting from trait
159-
`scala.ClassfileAnnotation` will be stored in the generated class
160-
files. Instances of an annotation class inheriting from trait
161-
`scala.StaticAnnotation` will be visible to the Scala type-checker
162-
in every compilation unit where the annotated symbol is accessed. An
163-
annotation class can inherit from both `scala.ClassfileAnnotation`
164-
and `scala.StaticAnnotation`. If an annotation class inherits from
165-
neither `scala.ClassfileAnnotation` nor
166-
`scala.StaticAnnotation`, its instances are visible only locally
167-
during the compilation run that analyzes them.
168-
169-
Classes inheriting from `scala.ClassfileAnnotation` may be
170-
subject to further restrictions in order to assure that they can be
171-
mapped to the host environment. In particular, on both the Java and
172-
the .NET platforms, such classes must be toplevel; i.e. they may not
173-
be contained in another class or object. Additionally, on both
174-
Java and .NET, all constructor arguments must be constant expressions.
156+
Other annotations may be interpreted by platform- or application-dependent
157+
tools. The class `scala.annotation.Annotation` is the base class for
158+
user-defined annotations. It has two sub-traits:
159+
- `scala.annotation.StaticAnnotation`: Instances of a subclass of this trait
160+
will be stored in the generated class files, and therefore accessible to
161+
runtime reflection and later compilation runs.
162+
- `scala.annotation.ConstantAnnotation`: Instances of a subclass of this trait
163+
may only have arguments which are
164+
[constant expressions](06-expressions.html#constant-expressions), and are
165+
also stored in the generated class files.
166+
- If an annotation class inherits from neither `scala.ConstantAnnotation` nor
167+
`scala.StaticAnnotation`, its instances are visible only locally during the
168+
compilation run that analyzes them.
169+
170+
## Host-platform Annotations
171+
172+
The host platform may define its own annotation format. These annotations do not
173+
extend any of the classes in the `scala.annotation` package, but can generally
174+
be used in the same way as Scala annotations. The host platform may impose
175+
additional restrictions on the expressions which are valid as annotation
176+
arguments.

src/compiler/scala/reflect/reify/phases/Reify.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ trait Reify extends GenSymbols
5151
case mods: global.Modifiers => reifyModifiers(mods)
5252
case xs: List[_] => reifyList(xs)
5353
case s: String => Literal(Constant(s))
54-
case s: scala.Symbol => Literal(Constant(s))
5554
case v if isAnyVal(v) => Literal(Constant(v))
5655
case null => Literal(Constant(null))
5756
case _ =>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class GenericRunnerSettings(error: String => Unit) extends Settings(error) {
1717
"how",
1818
"how to run the specified code",
1919
List("object", "script", "jar", "repl", "guess"),
20-
"guess")
20+
"guess") withAbbreviation "--how-to-run"
2121

2222
val loadfiles =
2323
MultiStringSetting(
@@ -41,11 +41,11 @@ class GenericRunnerSettings(error: String => Unit) extends Settings(error) {
4141
val save =
4242
BooleanSetting(
4343
"-save",
44-
"save the compiled script (assumes the code is a script)") withAbbreviation "-savecompiled"
44+
"save the compiled script (assumes the code is a script)") withAbbreviation "-savecompiled" withAbbreviation "--save"
4545

4646
val nc = BooleanSetting(
4747
"-nc",
48-
"do not use the legacy fsc compilation daemon").withAbbreviation("-nocompdaemon")
48+
"do not use the legacy fsc compilation daemon").withAbbreviation("-nocompdaemon").withAbbreviation("--no-compilation-daemon")
4949
.withDeprecationMessage("scripts use cold compilation by default; use -Yscriptrunner for custom behavior")
5050
.withPostSetHook { x: BooleanSetting => Yscriptrunner.value = if (x) "default" else "resident" }
5151
}

src/compiler/scala/tools/nsc/Global.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,6 +1473,9 @@ class Global(var currentSettings: Settings, reporter0: LegacyReporter)
14731473
if (settings.browse containsPhase globalPhase)
14741474
treeBrowser browse (phase.name, units)
14751475

1476+
if ((settings.Yvalidatepos containsPhase globalPhase) && !reporter.hasErrors)
1477+
currentRun.units.foreach(unit => validatePositions(unit.body))
1478+
14761479
// move the pointer
14771480
globalPhase = globalPhase.next
14781481

src/compiler/scala/tools/nsc/ScriptRunner.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
package scala.tools.nsc
77

8-
import scala.reflect.io.{Directory, File, Path}
8+
import scala.reflect.io.{Directory, File}
99
import scala.tools.nsc.classpath.DirectoryClassPath
1010
import scala.tools.nsc.reporters.{Reporter,ConsoleReporter}
1111
import scala.util.control.NonFatal

src/compiler/scala/tools/nsc/ast/TreeGen.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ abstract class TreeGen extends scala.reflect.internal.TreeGen with TreeDSL {
314314
// Rewrite This(enclModuleClass) to Ident(enclModuleClass) to avoid unnecessary capture of the module
315315
// class, which might hamper serializability.
316316
//
317-
// Analagous to this special case in ExplicitOuter: https://github.com/scala/scala/blob/d2d33ddf8c/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala#L410-L412
317+
// Analogous to this special case in ExplicitOuter: https://github.com/scala/scala/blob/d2d33ddf8c/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala#L410-L412
318318
// that understands that such references shouldn't give rise to outer params.
319319
val enclosingStaticModules = owner.enclClassChain.filter(x => !x.hasPackageFlag && x.isModuleClass && x.isStatic)
320320
enclosingStaticModules.foldLeft(tree)((tree, moduleClass) => tree.substituteThis(moduleClass, gen.mkAttributedIdent(moduleClass.sourceModule)) )

src/compiler/scala/tools/nsc/ast/Trees.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ trait Trees extends scala.reflect.internal.Trees { self: Global =>
289289
transform(fn)
290290
case EmptyTree =>
291291
tree
292+
// The typer does not accept UnApply. Replace it to Apply, which can be retyped.
293+
case UnApply(Apply(Select(prefix, termNames.unapply | termNames.unapplySeq),
294+
List(Ident(termNames.SELECTOR_DUMMY))), args) =>
295+
Apply(prefix, transformTrees(args))
292296
case _ =>
293297
val dupl = tree.duplicate
294298
// Typically the resetAttrs transformer cleans both symbols and types.

src/compiler/scala/tools/nsc/ast/parser/Parsers.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,14 +1300,15 @@ self =>
13001300
def finish(value: Any): Tree = try newLiteral(value) finally in.nextToken()
13011301
if (in.token == INTERPOLATIONID)
13021302
interpolatedString(inPattern = inPattern)
1303+
else if (in.token == SYMBOLLIT)
1304+
Apply(scalaDot(nme.Symbol), List(finish(in.strVal)))
13031305
else finish(in.token match {
13041306
case CHARLIT => in.charVal
13051307
case INTLIT => in.intVal(isNegated).toInt
13061308
case LONGLIT => in.intVal(isNegated)
13071309
case FLOATLIT => in.floatVal(isNegated)
13081310
case DOUBLELIT => in.doubleVal(isNegated)
13091311
case STRINGLIT | STRINGPART => in.strVal.intern()
1310-
case SYMBOLLIT => Symbol(in.strVal.intern())
13111312
case TRUE => true
13121313
case FALSE => false
13131314
case NULL => null
@@ -3000,9 +3001,14 @@ self =>
30003001
def template(): (List[Tree], ValDef, List[Tree]) = {
30013002
newLineOptWhenFollowedBy(LBRACE)
30023003
if (in.token == LBRACE) {
3004+
val braceOffset = in.offset
30033005
// @S: pre template body cannot stub like post body can!
30043006
val (self, body) = templateBody(isPre = true)
30053007
if (in.token == WITH && (self eq noSelfType)) {
3008+
val advice =
3009+
if (settings.isScala214) "use trait parameters instead."
3010+
else "they will be replaced by trait parameters in 2.14, see the migration guide on avoiding var/val in traits."
3011+
deprecationWarning(braceOffset, s"early initializers are deprecated; $advice", "2.13.0")
30063012
val earlyDefs: List[Tree] = body.map(ensureEarlyDef).filter(_.nonEmpty)
30073013
in.nextToken()
30083014
val parents = templateParents()

src/compiler/scala/tools/nsc/ast/parser/SyntaxAnalyzer.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ abstract class SyntaxAnalyzer extends SubComponent with Parsers with MarkupParse
9898
if (unit.body == EmptyTree)
9999
unit.body = initialUnitBody(unit)
100100

101-
if (settings.Yrangepos && !reporter.hasErrors)
102-
validatePositions(unit.body)
103-
104101
if (settings.Ymemberpos.isSetByUser)
105102
new MemberPosReporter(unit) show (style = settings.Ymemberpos.value)
106103
}

src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -444,10 +444,6 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder {
444444
assert(const.value != null, const) // TODO this invariant isn't documented in `case class Constant`
445445
mnode.visitLdcInsn(const.stringValue) // `stringValue` special-cases null, but not for a const with StringTag
446446

447-
case SSymbolTag =>
448-
mnode.visitLdcInsn(const.scalaSymbolValue.name)
449-
genCallMethod(SSymbol_apply, InvokeStyle.Static, NoPosition)
450-
451447
case NullTag => emit(asm.Opcodes.ACONST_NULL)
452448

453449
case ClazzTag =>
@@ -572,7 +568,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder {
572568
}
573569
}
574570

575-
// scala/bug#10290: qual can be `this.$outer()` (not just `this`), so we call genLoad (not jsut ALOAD_0)
571+
// scala/bug#10290: qual can be `this.$outer()` (not just `this`), so we call genLoad (not just ALOAD_0)
576572
genLoad(superQual)
577573
genLoadArguments(args, paramTKs(app))
578574
generatedType = genCallMethod(fun.symbol, InvokeStyle.Super, app.pos, sup.tpe.typeSymbol)

src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ package backend.jvm
99

1010
import scala.tools.asm
1111
import BackendReporting._
12-
import scala.reflect.internal.Flags
13-
import scala.tools.asm.{ByteVector, ClassWriter}
12+
import scala.tools.asm.ClassWriter
1413
import scala.tools.nsc.backend.jvm.BCodeHelpers.ScalaSigBytes
1514
import scala.tools.nsc.reporters.NoReporter
1615

@@ -32,7 +31,9 @@ abstract class BCodeHelpers extends BCodeIdiomatic {
3231
* True for classes generated by the Scala compiler that are considered top-level in terms of
3332
* the InnerClass / EnclosingMethod classfile attributes. See comment in BTypes.
3433
*/
35-
def considerAsTopLevelImplementationArtifact(classSym: Symbol) = classSym.isSpecialized
34+
def considerAsTopLevelImplementationArtifact(classSym: Symbol) =
35+
classSym.isSpecialized ||
36+
classSym.isSynthetic && classSym.name.containsName(nme.delayedInitArg.toTypeName)
3637

3738
/**
3839
* Cache the value of delambdafy == "inline" for each run. We need to query this value many

src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
package scala.tools.nsc
77
package backend.jvm
88

9-
import scala.collection.generic.Clearable
10-
import scala.collection.concurrent
119
import scala.tools.asm
1210
import scala.tools.asm.Opcodes
1311
import scala.tools.nsc.backend.jvm.BTypes.{InlineInfo, InternalName}

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,16 +207,9 @@ abstract class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
207207

208208
def implementedInterfaces(classSym: Symbol): List[Symbol] = {
209209

210-
// scala/bug#9393: java annotations are interfaces, but the classfile / java source parsers make them look like classes.
211-
def isInterfaceOrTrait(sym: Symbol) = sym.isInterface || sym.isTrait || sym.hasJavaAnnotationFlag
212-
213-
val classParents = {
214-
val parents = classSym.info.parents
215-
// scala/bug#9393: the classfile / java source parsers add Annotation and StaticAnnotation to the
216-
// parents of a java annotations. undo this for the backend (where we need classfile-level information).
217-
if (classSym.hasJavaAnnotationFlag) parents.filterNot(c => c.typeSymbol == StaticAnnotationClass || c.typeSymbol == AnnotationClass)
218-
else parents
219-
}
210+
def isInterfaceOrTrait(sym: Symbol) = sym.isInterface || sym.isTrait
211+
212+
val classParents = classSym.info.parents
220213

221214
val minimizedParents = if (classSym.isJavaDefined) classParents else erasure.minimizeParents(classSym, classParents)
222215
// We keep the superClass when computing minimizeParents to eliminate more interfaces.

src/compiler/scala/tools/nsc/backend/jvm/CoreBTypes.scala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,6 @@ abstract class CoreBTypesFromSymbols[G <: Global] extends CoreBTypes {
357357
})
358358
}
359359

360-
def SSymbol_apply: Symbol = _SSymbol_apply.get
361-
private[this] lazy val _SSymbol_apply: LazyVar[Symbol] = runLazy {
362-
getMember(SymbolModule, nme.apply)
363-
}
364-
365360
def lambdaMetaFactoryMetafactoryHandle: Handle = _lambdaMetaFactoryMetafactoryHandle.get
366361
private[this] lazy val _lambdaMetaFactoryMetafactoryHandle: LazyVar[Handle] = runLazy {
367362
new Handle(Opcodes.H_INVOKESTATIC,

src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import scala.tools.asm
1313
import scala.tools.asm.Opcodes._
1414
import scala.tools.asm.tree._
1515
import scala.tools.asm.tree.analysis._
16-
import scala.tools.asm.{Handle, Label, Type}
16+
import scala.tools.asm.{Handle, Type}
1717
import scala.tools.nsc.backend.jvm.BTypes._
1818
import scala.tools.nsc.backend.jvm.GenBCode._
1919
import scala.tools.nsc.backend.jvm.analysis.BackendUtils._

src/compiler/scala/tools/nsc/backend/jvm/opt/BytecodeUtils.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ package opt
99

1010
import scala.annotation.{tailrec, switch}
1111

12-
import scala.PartialFunction.cond
1312
import scala.reflect.internal.util.Collections._
1413
import scala.tools.asm.commons.CodeSizeEvaluator
1514
import scala.tools.asm.tree.analysis._

src/compiler/scala/tools/nsc/fsc/FscSettings.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ class FscSettings(error: String => Unit) extends Settings(error) {
1717
disable(resident)
1818
}
1919

20-
val currentDir = StringSetting ("-current-dir", "path", "Base directory for resolving relative paths", "").internalOnly()
21-
val reset = BooleanSetting("-reset", "Reset compile server caches")
22-
val shutdown = BooleanSetting("-shutdown", "Shutdown compile server")
23-
val server = StringSetting ("-server", "hostname:portnumber", "Specify compile server socket", "")
20+
val currentDir = StringSetting ("-current-dir", "path", "Base directory for resolving relative paths", "").internalOnly() withAbbreviation "--current-directory"
21+
val reset = BooleanSetting("-reset", "Reset compile server caches") withAbbreviation "--reset"
22+
val shutdown = BooleanSetting("-shutdown", "Shutdown compile server") withAbbreviation "--shutdown"
23+
val server = StringSetting ("-server", "hostname:portnumber", "Specify compile server socket", "") withAbbreviation "--server"
2424
val port = IntSetting ("-port", "Search and start compile server in given port only",
25-
0, Some((0, Int.MaxValue)), (_: String) => None)
26-
val preferIPv4 = BooleanSetting("-ipv4", "Use IPv4 rather than IPv6 for the server socket")
25+
0, Some((0, Int.MaxValue)), (_: String) => None) withAbbreviation "--port"
26+
val preferIPv4 = BooleanSetting("-ipv4", "Use IPv4 rather than IPv6 for the server socket") withAbbreviation "--ipv4"
2727
val idleMins = IntSetting ("-max-idle", "Set idle timeout in minutes for fsc (use 0 for no timeout)",
28-
30, Some((0, Int.MaxValue)), (_: String) => None)
28+
30, Some((0, Int.MaxValue)), (_: String) => None) withAbbreviation "--max-idle"
2929

3030
// For improved help output, separating fsc options from the others.
3131
def fscSpecific = Set[Settings#Setting](

src/compiler/scala/tools/nsc/io/Jar.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class Jar(file: File) extends AbstractIterable[JarEntry] {
7777
Iterator continually in.getNextJarEntry() takeWhile (_ != null) foreach f
7878
}
7979
override def iterator: Iterator[JarEntry] = this.toList.iterator
80+
override def isEmpty: Boolean = iterator.isEmpty
8081
override def toString = "" + file
8182
}
8283

src/compiler/scala/tools/nsc/javac/JavaParsers.scala

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -770,11 +770,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
770770
val idefs = members.toList ::: (sdefs flatMap forwarders)
771771
(sdefs, idefs)
772772
}
773-
def annotationParents = List(
774-
gen.scalaAnnotationDot(tpnme.Annotation),
775-
Select(javaLangDot(nme.annotation), tpnme.Annotation),
776-
gen.scalaAnnotationDot(tpnme.StaticAnnotation)
777-
)
773+
def annotationParents = Select(javaLangDot(nme.annotation), tpnme.Annotation) :: Nil
778774
def annotationDecl(mods: Modifiers): List[Tree] = {
779775
accept(AT)
780776
accept(INTERFACE)
@@ -783,7 +779,10 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
783779
val (statics, body) = typeBody(AT, name)
784780
val templ = makeTemplate(annotationParents, body)
785781
addCompanionObject(statics, atPos(pos) {
786-
ClassDef(mods | Flags.JAVA_ANNOTATION, name, List(), templ)
782+
import Flags._
783+
ClassDef(
784+
mods | JAVA_ANNOTATION | TRAIT | INTERFACE | ABSTRACT,
785+
name, List(), templ)
787786
})
788787
}
789788

src/compiler/scala/tools/nsc/profile/Profiler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private [profile] class RealProfiler(reporter : ProfileReporter, val settings: S
124124
}
125125
private def readHeapUsage() = RealProfiler.memoryMx.getHeapMemoryUsage.getUsed
126126

127-
private def doGC: Unit = {
127+
private def doGC(): Unit = {
128128
System.gc()
129129
System.runFinalization()
130130
}

0 commit comments

Comments
 (0)