From 944db65d63e12ae4e0135999cdc8b9f2695f4102 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Fri, 18 Nov 2016 16:04:49 +1000 Subject: SI-10066 Fix crash in erroneous code with implicits, dynamic The compiler support in the typechecker for `scala.Dynamic` is very particular about the `Context` in which it is typechecked. It looks at the `tree` in the enclosing context to find the expression immediately enclosing the dynamic selection. See the logic in `dyna::mkInvoke` for the details. This commit substitutes the result of `resetAttrs` into the tree of the typer context before continuing with typechecking. --- .../scala/tools/nsc/typechecker/Typers.scala | 23 +++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index cca6f280e3..192917d4aa 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -863,11 +863,24 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper case _ => } debuglog(s"fallback on implicits: ${tree}/$resetTree") - val tree1 = typed(resetTree, mode) - // Q: `typed` already calls `pluginsTyped` and `adapt`. the only difference here is that - // we pass `EmptyTree` as the `original`. intended? added in 2009 (53d98e7d42) by martin. - tree1 setType pluginsTyped(tree1.tpe, this, tree1, mode, pt) - if (tree1.isEmpty) tree1 else adapt(tree1, mode, pt, EmptyTree) + // SO-10066 Need to patch the enclosing tree in the context to make translation of Dynamic + // work during fallback typechecking below. + val resetContext: Context = { + object substResetForOriginal extends Transformer { + override def transform(tree: Tree): Tree = { + if (tree eq original) resetTree + else super.transform(tree) + } + } + context.make(substResetForOriginal.transform(context.tree)) + } + typerWithLocalContext(resetContext) { typer1 => + val tree1 = typer1.typed(resetTree, mode) + // Q: `typed` already calls `pluginsTyped` and `adapt`. the only difference here is that + // we pass `EmptyTree` as the `original`. intended? added in 2009 (53d98e7d42) by martin. + tree1 setType pluginsTyped(tree1.tpe, typer1, tree1, mode, pt) + if (tree1.isEmpty) tree1 else typer1.adapt(tree1, mode, pt, EmptyTree) + } } ) else -- cgit v1.2.3 From 0f3f635d30551b1b96c64b955a85a3e535d1f2d2 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Wed, 7 Dec 2016 15:39:51 +0100 Subject: SI-10072 cast Function nodes to environment in specialization This commit basically make sure the fix for SI-5284 works correctly when a Function node reaches specialization (`-Ydealmbdafy:method` and IndyLambda are default in 2.12.x). To understand it, best read the excellent description in b29c01b. The code that's removed in this commit was added in 13ea590. It prevented `castType` from being invoked on the `Function` node, which is exactly what is needed here. It's also what happens under `-Ydelambdafy:inline`, the `new anonfun()` tree is being casted from `(Int, Int) => Int` to `(Int, A) => Int`. --- .../scala/tools/nsc/typechecker/Duplicators.scala | 4 ---- test/files/run/t10072.scala | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 test/files/run/t10072.scala (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala index df014b5161..ea82739504 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala @@ -240,10 +240,6 @@ abstract class Duplicators extends Analyzer { result.symbol.updateAttachment(DelambdafyTarget) result - case fun: Function => - debuglog("Clearing the type and retyping Function: " + fun) - super.typed(fun.clearType, mode, pt) - case vdef @ ValDef(mods, name, tpt, rhs) => // log("vdef fixing tpe: " + tree.tpe + " with sym: " + tree.tpe.typeSymbol + " and " + invalidSyms) //if (mods.hasFlag(Flags.LAZY)) vdef.symbol.resetFlag(Flags.MUTABLE) // Martin to Iulian: lazy vars can now appear because they are no longer boxed; Please check that deleting this statement is OK. diff --git a/test/files/run/t10072.scala b/test/files/run/t10072.scala new file mode 100644 index 0000000000..0f1dca1838 --- /dev/null +++ b/test/files/run/t10072.scala @@ -0,0 +1,18 @@ +trait T[A] { + def a: A + def foldLeft[B](zero: B, op: (B, A) => B): B = op(zero, a) + def sum[B >: A](zero: B): B +} + +class C[@specialized(Int) A](val a: A) extends T[A] { + override def sum[@specialized(Int) B >: A](zero: B): B = foldLeft(zero, (x: B, y: B) => x) +} + +object Test extends App { + def factory[T](a: T): C[T] = new C[T](a) + + assert(new C[Int](1).sum(2) == 2) + assert(new C[String]("ho").sum("hu") == "hu") + assert(factory[Int](1).sum(2) == 2) + assert(factory[String]("ho").sum("hu") == "hu") +} -- cgit v1.2.3 From f1aa0b3795a8f649e71fa84e52e5b6f86257f3cb Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Fri, 18 Nov 2016 22:39:35 -0800 Subject: SI-9636 More precise error pos on apply inference If a method type arg is inferred Any, warn about the function and not the innocent arg. --- .../scala/tools/nsc/typechecker/Infer.scala | 56 ++++++++++------------ test/files/neg/t9636.check | 6 +++ test/files/neg/t9636.flags | 1 + test/files/neg/t9636.scala | 17 +++++++ test/files/neg/warn-inferred-any.check | 2 +- 5 files changed, 49 insertions(+), 33 deletions(-) create mode 100644 test/files/neg/t9636.check create mode 100644 test/files/neg/t9636.flags create mode 100644 test/files/neg/t9636.scala (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index e8147dbf3a..9dd260b274 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -495,21 +495,22 @@ trait Infer extends Checkable { } /** Return inferred type arguments, given type parameters, formal parameters, - * argument types, result type and expected result type. - * If this is not possible, throw a `NoInstance` exception. - * Undetermined type arguments are represented by `definitions.NothingTpe`. - * No check that inferred parameters conform to their bounds is made here. - * - * @param tparams the type parameters of the method - * @param formals the value parameter types of the method - * @param restpe the result type of the method - * @param argtpes the argument types of the application - * @param pt the expected return type of the application - * @return @see adjustTypeArgs - * - * @throws NoInstance - */ - def methTypeArgs(tparams: List[Symbol], formals: List[Type], restpe: Type, + * argument types, result type and expected result type. + * If this is not possible, throw a `NoInstance` exception. + * Undetermined type arguments are represented by `definitions.NothingTpe`. + * No check that inferred parameters conform to their bounds is made here. + * + * @param fn the function for reporting, may be empty + * @param tparams the type parameters of the method + * @param formals the value parameter types of the method + * @param restpe the result type of the method + * @param argtpes the argument types of the application + * @param pt the expected return type of the application + * @return @see adjustTypeArgs + * + * @throws NoInstance + */ + def methTypeArgs(fn: Tree, tparams: List[Symbol], formals: List[Type], restpe: Type, argtpes: List[Type], pt: Type): AdjustedTypeArgs.Result = { val tvars = tparams map freshVar if (!sameLength(formals, argtpes)) @@ -559,21 +560,12 @@ trait Infer extends Checkable { val hasAny = pt :: restpe :: formals ::: argtpes ::: loBounds exists (_.dealiasWidenChain exists containsAny) !hasAny } - def argumentPosition(idx: Int): Position = context.tree match { - case x: ValOrDefDef => x.rhs match { - case Apply(fn, args) if idx < args.size => args(idx).pos - case _ => context.tree.pos - } - case _ => context.tree.pos - } - if (settings.warnInferAny && context.reportErrors && canWarnAboutAny) { - foreachWithIndex(targs) ((targ, idx) => - targ.typeSymbol match { - case sym @ (AnyClass | AnyValClass) => - reporter.warning(argumentPosition(idx), s"a type was inferred to be `${sym.name}`; this may indicate a programming error.") - case _ => - } - ) + if (settings.warnInferAny && context.reportErrors && !fn.isEmpty && canWarnAboutAny) { + targs.foreach(_.typeSymbol match { + case sym @ (AnyClass | AnyValClass) => + reporter.warning(fn.pos, s"a type was inferred to be `${sym.name}`; this may indicate a programming error.") + case _ => + }) } adjustTypeArgs(tparams, tvars, targs, restpe) } @@ -735,7 +727,7 @@ trait Infer extends Checkable { ) def tryInstantiating(args: List[Type]) = falseIfNoInstance { val restpe = mt resultType args - val AdjustedTypeArgs.Undets(okparams, okargs, leftUndet) = methTypeArgs(undetparams, formals, restpe, args, pt) + val AdjustedTypeArgs.Undets(okparams, okargs, leftUndet) = methTypeArgs(EmptyTree, undetparams, formals, restpe, args, pt) val restpeInst = restpe.instantiateTypeParams(okparams, okargs) // #2665: must use weak conformance, not regular one (follow the monomorphic case above) exprTypeArgs(leftUndet, restpeInst, pt, useWeaklyCompatible = true) match { @@ -989,7 +981,7 @@ trait Infer extends Checkable { val restpe = fn.tpe.resultType(argtpes) val AdjustedTypeArgs.AllArgsAndUndets(okparams, okargs, allargs, leftUndet) = - methTypeArgs(undetparams, formals, restpe, argtpes, pt) + methTypeArgs(fn, undetparams, formals, restpe, argtpes, pt) if (checkBounds(fn, NoPrefix, NoSymbol, undetparams, allargs, "inferred ")) { val treeSubst = new TreeTypeSubstituter(okparams, okargs) diff --git a/test/files/neg/t9636.check b/test/files/neg/t9636.check new file mode 100644 index 0000000000..f36d1d32b2 --- /dev/null +++ b/test/files/neg/t9636.check @@ -0,0 +1,6 @@ +t9636.scala:11: warning: a type was inferred to be `AnyVal`; this may indicate a programming error. + if (signature.sameElements(Array(0x1F, 0x8B))) { + ^ +error: No warnings can be incurred under -Xfatal-warnings. +one warning found +one error found diff --git a/test/files/neg/t9636.flags b/test/files/neg/t9636.flags new file mode 100644 index 0000000000..7949c2afa2 --- /dev/null +++ b/test/files/neg/t9636.flags @@ -0,0 +1 @@ +-Xlint -Xfatal-warnings diff --git a/test/files/neg/t9636.scala b/test/files/neg/t9636.scala new file mode 100644 index 0000000000..7ad5fb3e9e --- /dev/null +++ b/test/files/neg/t9636.scala @@ -0,0 +1,17 @@ + +import java.io._ +import java.util.zip._ + +class C { + def isWrapper(is: FileInputStream): InputStream = { + val pb = new PushbackInputStream(is, 2) + val signature = new Array[Byte](2) + pb.read(signature) + pb.unread(signature) + if (signature.sameElements(Array(0x1F, 0x8B))) { + new GZIPInputStream(new BufferedInputStream(pb)) + } else { + pb + } + } +} diff --git a/test/files/neg/warn-inferred-any.check b/test/files/neg/warn-inferred-any.check index 8ad81d1529..2b321a83c9 100644 --- a/test/files/neg/warn-inferred-any.check +++ b/test/files/neg/warn-inferred-any.check @@ -9,7 +9,7 @@ warn-inferred-any.scala:17: warning: a type was inferred to be `AnyVal`; this ma ^ warn-inferred-any.scala:25: warning: a type was inferred to be `Any`; this may indicate a programming error. def za = f(1, "one") - ^ + ^ error: No warnings can be incurred under -Xfatal-warnings. four warnings found one error found -- cgit v1.2.3 From a262aaba15effce48fdba95910bef367f89cafca Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Tue, 17 Jan 2017 01:32:05 -0800 Subject: SI-10148 Follow Java for float literals Use `Float.parseFloat` instead of converting from Double. Error when a value rounds to zero. --- .../scala/tools/nsc/ast/parser/Parsers.scala | 4 +-- .../scala/tools/nsc/ast/parser/Scanners.scala | 34 ++++++++++++++++++---- test/files/neg/literals.check | 14 ++++++++- test/files/neg/literals.scala | 13 ++++++++- test/files/run/literals.scala | 5 ++++ 5 files changed, 60 insertions(+), 10 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index cf66e0a7dc..d7d0f01741 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -1263,8 +1263,8 @@ self => case CHARLIT => in.charVal case INTLIT => in.intVal(isNegated).toInt case LONGLIT => in.intVal(isNegated) - case FLOATLIT => in.floatVal(isNegated).toFloat - case DOUBLELIT => in.floatVal(isNegated) + case FLOATLIT => in.floatVal(isNegated) + case DOUBLELIT => in.doubleVal(isNegated) case STRINGLIT | STRINGPART => in.strVal.intern() case TRUE => true case FALSE => false diff --git a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala index a8cc7f91c2..ccd0d4a9c9 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala @@ -972,23 +972,45 @@ trait Scanners extends ScannersCommon { def intVal: Long = intVal(negated = false) - /** Convert current strVal, base to double value + /** Convert current strVal, base to float value. */ - def floatVal(negated: Boolean): Double = { - val limit: Double = if (token == DOUBLELIT) Double.MaxValue else Float.MaxValue + def floatVal(negated: Boolean): Float = { try { - val value: Double = java.lang.Double.valueOf(strVal).doubleValue() - if (value > limit) + val value: Float = java.lang.Float.parseFloat(strVal) + if (value > Float.MaxValue) syntaxError("floating point number too large") + val zeroly = "0.fF" + if (value == 0.0f && strVal.exists(c => !zeroly.contains(c))) + syntaxError("floating point number too small") if (negated) -value else value } catch { case _: NumberFormatException => syntaxError("malformed floating point number") + 0.0f + } + } + + def floatVal: Float = floatVal(negated = false) + + /** Convert current strVal, base to double value. + */ + def doubleVal(negated: Boolean): Double = { + try { + val value: Double = java.lang.Double.parseDouble(strVal) + if (value > Double.MaxValue) + syntaxError("double precision floating point number too large") + val zeroly = "0.dD" + if (value == 0.0d && strVal.exists(c => !zeroly.contains(c))) + syntaxError("double precision floating point number too small") + if (negated) -value else value + } catch { + case _: NumberFormatException => + syntaxError("malformed double precision floating point number") 0.0 } } - def floatVal: Double = floatVal(negated = false) + def doubleVal: Double = doubleVal(negated = false) def checkNoLetter(): Unit = { if (isIdentifierPart(ch) && ch >= ' ') diff --git a/test/files/neg/literals.check b/test/files/neg/literals.check index 148a9346c5..79b6d47782 100644 --- a/test/files/neg/literals.check +++ b/test/files/neg/literals.check @@ -19,6 +19,18 @@ literals.scala:23: error: missing integer number literals.scala:27: error: Decimal integer literals may not have a leading zero. (Octal syntax is obsolete.) def tooManyZeros: Int = 00 // line 26: no leading zero ^ +literals.scala:40: error: floating point number too small + def tooTiny: Float = { 0.7e-45f } // floating point number too small + ^ +literals.scala:42: error: double precision floating point number too small + def twoTiny: Double = { 2.0e-324 } // double precision floating point number too small + ^ +literals.scala:44: error: floating point number too large + def tooHuge: Float = { 3.4028236E38f } // floating point number too large + ^ +literals.scala:46: error: double precision floating point number too large + def twoHuge: Double = { 1.7976931348623159e308 } // double precision floating point number too large + ^ literals.scala:14: error: identifier expected but '}' found. def orphanDot: Int = { 9. } // line 12: ident expected ^ @@ -37,4 +49,4 @@ literals.scala:29: error: ';' expected but 'def' found. literals.scala:33: error: identifier expected but 'def' found. def zeroOfNineDot: Int = 09. // line 32: malformed integer, ident expected ^ -13 errors found +17 errors found diff --git a/test/files/neg/literals.scala b/test/files/neg/literals.scala index 3df7f0b408..22d5d9acd1 100644 --- a/test/files/neg/literals.scala +++ b/test/files/neg/literals.scala @@ -1,6 +1,6 @@ /* This took me literally all day. -*/ + */ trait RejectedLiterals { def missingHex: Int = { 0x } // line 4: was: not reported, taken as zero @@ -34,3 +34,14 @@ trait Braceless { def noHexFloat: Double = 0x1.2 // line 34: ';' expected but double literal found. } + +trait MoreSadness { + + def tooTiny: Float = { 0.7e-45f } // floating point number too small + + def twoTiny: Double = { 2.0e-324 } // double precision floating point number too small + + def tooHuge: Float = { 3.4028236E38f } // floating point number too large + + def twoHuge: Double = { 1.7976931348623159e308 } // double precision floating point number too large +} diff --git a/test/files/run/literals.scala b/test/files/run/literals.scala index 13fda05876..25501123b5 100644 --- a/test/files/run/literals.scala +++ b/test/files/run/literals.scala @@ -84,6 +84,10 @@ object Test { check_success("3.14f == 3.14f", 3.14f, 3.14f) check_success("6.022e23f == 6.022e23f", 6.022e23f, 6.022e23f) check_success("09f == 9.0f", 09f, 9.0f) + check_success("1.00000017881393421514957253748434595763683319091796875001f == 1.0000001f", + 1.00000017881393421514957253748434595763683319091796875001f, + 1.0000001f) + check_success("3.4028235E38f == Float.MaxValue", 3.4028235E38f, Float.MaxValue) check_success("1.asInstanceOf[Float] == 1.0", 1.asInstanceOf[Float], 1.0f) check_success("1l.asInstanceOf[Float] == 1.0", 1l.asInstanceOf[Float], 1.0f) @@ -97,6 +101,7 @@ object Test { check_success("3.14 == 3.14", 3.14, 3.14) check_success("1e-9d == 1.0e-9", 1e-9d, 1.0e-9) check_success("1e137 == 1.0e137", 1e137, 1.0e137) + check_success("1.7976931348623157e308d == Double.MaxValue", 1.7976931348623157e308d, Double.MaxValue) check_success("1.asInstanceOf[Double] == 1.0", 1.asInstanceOf[Double], 1.0) check_success("1l.asInstanceOf[Double] == 1.0", 1l.asInstanceOf[Double], 1.0) -- cgit v1.2.3 From 6864d32fbd903ce67d43ef9e0b9f011baabc8695 Mon Sep 17 00:00:00 2001 From: teldosas Date: Wed, 1 Feb 2017 02:32:10 +0200 Subject: Add warning about non-sensible equals in anonymous functions --- .../scala/tools/nsc/typechecker/RefChecks.scala | 2 +- test/files/neg/t9675.check | 27 ++++++++++++++++++++++ test/files/neg/t9675.flags | 1 + test/files/neg/t9675.scala | 24 +++++++++++++++++++ 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 test/files/neg/t9675.check create mode 100644 test/files/neg/t9675.flags create mode 100644 test/files/neg/t9675.scala (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index 296d9c6bca..dcf9ff39c9 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -1130,7 +1130,7 @@ abstract class RefChecks extends Transform { } /** Sensibility check examines flavors of equals. */ def checkSensible(pos: Position, fn: Tree, args: List[Tree]) = fn match { - case Select(qual, name @ (nme.EQ | nme.NE | nme.eq | nme.ne)) if args.length == 1 && isObjectOrAnyComparisonMethod(fn.symbol) && !currentOwner.isSynthetic => + case Select(qual, name @ (nme.EQ | nme.NE | nme.eq | nme.ne)) if args.length == 1 && isObjectOrAnyComparisonMethod(fn.symbol) && (!currentOwner.isSynthetic || currentOwner.isAnonymousFunction) => checkSensibleEquals(pos, qual, name, fn.symbol, args.head) case _ => } diff --git a/test/files/neg/t9675.check b/test/files/neg/t9675.check new file mode 100644 index 0000000000..255477499c --- /dev/null +++ b/test/files/neg/t9675.check @@ -0,0 +1,27 @@ +t9675.scala:4: warning: comparing values of types Test.A and String using `!=' will always yield true + val func1 = (x: A) => { x != "x" } + ^ +t9675.scala:6: warning: comparing values of types Test.A and String using `!=' will always yield true + val func2 = (x: A) => { x != "x" }: Boolean + ^ +t9675.scala:8: warning: comparing values of types Test.A and String using `!=' will always yield true + val func3: Function1[A, Boolean] = (x) => { x != "x" } + ^ +t9675.scala:11: warning: comparing values of types Test.A and String using `!=' will always yield true + def apply(x: A): Boolean = { x != "x" } + ^ +t9675.scala:14: warning: comparing values of types Test.A and String using `!=' will always yield true + def method(x: A): Boolean = { x != "x" } + ^ +t9675.scala:18: warning: comparing values of types Test.A and String using `!=' will always yield true + A("x") != "x" + ^ +t9675.scala:20: warning: comparing values of types Test.A and String using `!=' will always yield true + val func5: Function1[A, Boolean] = (x) => { x != "x" } + ^ +t9675.scala:22: warning: comparing values of types Test.A and String using `!=' will always yield true + List(A("x")).foreach((item: A) => item != "x") + ^ +error: No warnings can be incurred under -Xfatal-warnings. +8 warnings found +one error found diff --git a/test/files/neg/t9675.flags b/test/files/neg/t9675.flags new file mode 100644 index 0000000000..85d8eb2ba2 --- /dev/null +++ b/test/files/neg/t9675.flags @@ -0,0 +1 @@ +-Xfatal-warnings diff --git a/test/files/neg/t9675.scala b/test/files/neg/t9675.scala new file mode 100644 index 0000000000..f76b74b6ac --- /dev/null +++ b/test/files/neg/t9675.scala @@ -0,0 +1,24 @@ +object Test { + case class A(x: String) + + val func1 = (x: A) => { x != "x" } + + val func2 = (x: A) => { x != "x" }: Boolean + + val func3: Function1[A, Boolean] = (x) => { x != "x" } + + val func4 = new Function1[A, Boolean] { + def apply(x: A): Boolean = { x != "x" } + } + + def method(x: A): Boolean = { x != "x" } + case class PersonInfo(rankPayEtc: Unit) + + def main(args: Array[String]) { + A("x") != "x" + + val func5: Function1[A, Boolean] = (x) => { x != "x" } + + List(A("x")).foreach((item: A) => item != "x") + } +} -- cgit v1.2.3 From 1eb331b4196492f8f8084a2c102272c3a9c0cd2d Mon Sep 17 00:00:00 2001 From: Janek Bogucki Date: Sun, 12 Feb 2017 21:24:56 +0000 Subject: Fix typos in compiler and reflect Miscellania: Miscellania is a small island off the northernmost part of the Fremennik Isles - RunScape Wiki Miscellanea: A collection of miscellaneous objects or writings - Merriam-Webster --- src/compiler/scala/tools/nsc/Global.scala | 2 +- src/compiler/scala/tools/nsc/PhaseAssembly.scala | 2 +- src/compiler/scala/tools/nsc/backend/jvm/AsmUtils.scala | 2 +- .../scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala | 2 +- src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala | 8 ++++---- src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala | 10 +++++----- src/compiler/scala/tools/nsc/backend/jvm/BytecodeWriters.scala | 2 +- .../scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala | 3 ++- .../scala/tools/nsc/backend/jvm/analysis/package.scala | 2 +- src/compiler/scala/tools/nsc/backend/jvm/opt/BoxUnbox.scala | 6 +++--- .../scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala | 6 +++--- src/compiler/scala/tools/nsc/backend/jvm/opt/CallGraph.scala | 2 +- src/compiler/scala/tools/nsc/backend/jvm/opt/CopyProp.scala | 4 ++-- .../scala/tools/nsc/backend/jvm/opt/InlineInfoAttribute.scala | 2 +- src/compiler/scala/tools/nsc/backend/jvm/opt/Inliner.scala | 4 ++-- .../scala/tools/nsc/backend/jvm/opt/InlinerHeuristics.scala | 2 +- src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala | 2 +- .../scala/tools/nsc/classpath/DirectoryClassPath.scala | 2 +- src/compiler/scala/tools/nsc/javac/JavaParsers.scala | 2 +- src/compiler/scala/tools/nsc/transform/AccessorSynthesis.scala | 2 +- src/compiler/scala/tools/nsc/transform/Delambdafy.scala | 4 ++-- src/compiler/scala/tools/nsc/transform/Fields.scala | 2 +- src/compiler/scala/tools/nsc/transform/LambdaLift.scala | 2 +- src/compiler/scala/tools/nsc/transform/Mixin.scala | 4 ++-- src/compiler/scala/tools/nsc/transform/SampleTransform.scala | 2 +- src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala | 2 +- src/compiler/scala/tools/nsc/transform/UnCurry.scala | 4 ++-- src/compiler/scala/tools/nsc/transform/patmat/Logic.scala | 4 ++-- .../scala/tools/nsc/transform/patmat/MatchTreeMaking.scala | 4 ++-- src/compiler/scala/tools/nsc/util/package.scala | 2 +- src/reflect/scala/reflect/internal/Definitions.scala | 4 ++-- src/reflect/scala/reflect/internal/Positions.scala | 2 +- src/reflect/scala/reflect/internal/Scopes.scala | 2 +- src/reflect/scala/reflect/internal/Types.scala | 6 +++--- src/reflect/scala/reflect/internal/pickling/UnPickler.scala | 2 +- src/reflect/scala/reflect/internal/tpe/GlbLubs.scala | 2 +- src/reflect/scala/reflect/internal/tpe/TypeComparers.scala | 2 +- src/reflect/scala/reflect/internal/tpe/TypeConstraints.scala | 2 +- src/reflect/scala/reflect/internal/tpe/TypeMaps.scala | 6 +++--- src/reflect/scala/reflect/internal/transform/Erasure.scala | 2 +- src/reflect/scala/reflect/internal/util/Statistics.scala | 2 +- src/reflect/scala/reflect/macros/blackbox/Context.scala | 2 +- 42 files changed, 66 insertions(+), 65 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 40be302799..c1b0733895 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -1198,7 +1198,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter) first } - // --------------- Miscellania ------------------------------- + // --------------- Miscellanea ------------------------------- /** Progress tracking. Measured in "progress units" which are 1 per * compilation unit per phase completed. diff --git a/src/compiler/scala/tools/nsc/PhaseAssembly.scala b/src/compiler/scala/tools/nsc/PhaseAssembly.scala index ef9818c62d..df72c37e53 100644 --- a/src/compiler/scala/tools/nsc/PhaseAssembly.scala +++ b/src/compiler/scala/tools/nsc/PhaseAssembly.scala @@ -17,7 +17,7 @@ trait PhaseAssembly { self: Global => /** - * Aux datastructure for solving the constraint system + * Aux data structure for solving the constraint system * The dependency graph container with helper methods for node and edge creation */ private class DependencyGraph { diff --git a/src/compiler/scala/tools/nsc/backend/jvm/AsmUtils.scala b/src/compiler/scala/tools/nsc/backend/jvm/AsmUtils.scala index 1982c7f643..402dc66a7f 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/AsmUtils.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/AsmUtils.scala @@ -33,7 +33,7 @@ object AsmUtils { final val traceClassPattern = "" /** - * Print the bytedcode of classes as they are serialized by the ASM library. The serialization + * Print the bytecode of classes as they are serialized by the ASM library. The serialization * performed by `asm.ClassWriter` can change the code generated by GenBCode. For example, it * introduces stack map frames, it computes the maximal stack sizes, and it replaces dead * code by NOPs (see also https://github.com/scala/scala/pull/3726#issuecomment-42861780). diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala index c7952ffe94..76d042ce3b 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala @@ -918,7 +918,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { (args zip params) filterNot isTrivial } - // first push *all* arguments. This makes sure muliple uses of the same labelDef-var will all denote the (previous) value. + // first push *all* arguments. This makes sure multiple uses of the same labelDef-var will all denote the (previous) value. aps foreach { case (arg, param) => genLoad(arg, locals(param).tk) } // `locals` is known to contain `param` because `genDefDef()` visited `labelDefsAtOrUnder` // second assign one by one to the LabelDef's variables. diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala index 18e7500172..a74c70a684 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala @@ -188,7 +188,7 @@ abstract class BCodeHelpers extends BCodeIdiomatic with BytecodeWriters { * Data for emitting an EnclosingMethod attribute. None if `classSym` is a member class (not * an anonymous or local class). See doc in BTypes. * - * The class is parametrized by two functions to obtain a bytecode class descriptor for a class + * The class is parameterized by two functions to obtain a bytecode class descriptor for a class * symbol, and to obtain a method signature descriptor fro a method symbol. These function depend * on the implementation of GenASM / GenBCode, so they need to be passed in. */ @@ -332,7 +332,7 @@ abstract class BCodeHelpers extends BCodeIdiomatic with BytecodeWriters { failNoForwarder("companion contains its own main method (implementation restriction: no main is allowed, regardless of signature)") else if (companion.isTrait) failNoForwarder("companion is a trait") - // Now either succeeed, or issue some additional warnings for things which look like + // Now either succeed, or issue some additional warnings for things which look like // attempts to be java main methods. else (possibles exists definitions.isJavaMainMethod) || { possibles exists { m => @@ -541,9 +541,9 @@ abstract class BCodeHelpers extends BCodeIdiomatic with BytecodeWriters { * symbol (sym.annotations) or type (as an AnnotatedType, eliminated by erasure). * * For Scala annotations this is OK: they are stored in the pickle and ignored by the backend. - * Java annoations on the other hand are additionally emitted to the classfile in Java's format. + * Java annotations on the other hand are additionally emitted to the classfile in Java's format. * - * This means that [[Type]] instances within an AnnotaionInfo reach the backend non-erased. Examples: + * This means that [[Type]] instances within an AnnotationInfo reach the backend non-erased. Examples: * - @(javax.annotation.Resource @annotation.meta.getter) val x = 0 * Here, annotationInfo.atp is an AnnotatedType. * - @SomeAnnotation[T] val x = 0 diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala b/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala index 121091fe4f..3e3229d2c3 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala @@ -83,7 +83,7 @@ abstract class BTypes { val callsitePositions: concurrent.Map[MethodInsnNode, Position] = recordPerRunCache(TrieMap.empty) /** - * Stores callsite instructions of invocatinos annotated `f(): @inline/noinline`. + * Stores callsite instructions of invocations annotated `f(): @inline/noinline`. * Instructions are added during code generation (BCodeBodyBuilder). The maps are then queried * when building the CallGraph, every Callsite object has an annotated(No)Inline field. */ @@ -287,7 +287,7 @@ abstract class BTypes { } // The InlineInfo is built from the classfile (not from the symbol) for all classes that are NOT - // being compiled. For those classes, the info is only needed if the inliner is enabled, othewise + // being compiled. For those classes, the info is only needed if the inliner is enabled, otherwise // we can save the memory. if (!compilerSettings.optInlinerEnabled) BTypes.EmptyInlineInfo else fromClassfileAttribute getOrElse fromClassfileWithoutAttribute @@ -653,7 +653,7 @@ abstract class BTypes { * Fields in the InnerClass entries: * - inner class: the (nested) class C we are talking about * - outer class: the class of which C is a member. Has to be null for non-members, i.e. for - * local and anonymous classes. NOTE: this co-incides with the presence of an + * local and anonymous classes. NOTE: this coincides with the presence of an * EnclosingMethod attribute (see below) * - inner name: A string with the simple name of the inner class. Null for anonymous classes. * - flags: access property flags, details in JVMS, table in 4.7.6. Static flag: see @@ -702,7 +702,7 @@ abstract class BTypes { * local and anonymous classes, no matter if there is an enclosing method or not. Accordingly, the * "class" field (see below) must be always defined, while the "method" field may be null. * - * NOTE: When an EnclosingMethod attribute is requried (local and anonymous classes), the "outer" + * NOTE: When an EnclosingMethod attribute is required (local and anonymous classes), the "outer" * field in the InnerClass table must be null. * * Fields: @@ -1144,7 +1144,7 @@ object BTypes { /** * Metadata about a ClassBType, used by the inliner. * - * More information may be added in the future to enable more elaborate inlinine heuristics. + * More information may be added in the future to enable more elaborate inline heuristics. * Note that this class should contain information that can only be obtained from the ClassSymbol. * Information that can be computed from the ClassNode should be added to the call graph instead. * diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BytecodeWriters.scala b/src/compiler/scala/tools/nsc/backend/jvm/BytecodeWriters.scala index 84f6d87c5c..2cf5cfcb8d 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BytecodeWriters.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BytecodeWriters.scala @@ -78,7 +78,7 @@ trait BytecodeWriters { } /* - * The ASM textual representation for bytecode overcomes disadvantages of javap ouput in three areas: + * The ASM textual representation for bytecode overcomes disadvantages of javap output in three areas: * (a) pickle dingbats undecipherable to the naked eye; * (b) two constant pools, while having identical contents, are displayed differently due to physical layout. * (c) stack maps (classfile version 50 and up) are displayed in encoded form by javap, diff --git a/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala b/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala index e25b55e7ab..90da570f01 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala @@ -382,7 +382,8 @@ class BackendUtils[BT <: BTypes](val btypes: BT) { * but not for writing in the classfile. We let the ClassWriter recompute max's. * * NOTE 2: the maxStack value computed here may be larger than the smallest correct value - * that would allow running an analyzer, see `InstructionStackEffect.forAsmAnalysisConservative`. + * that would allow running an analyzer, see `InstructionStackEffect.forAsmAnalysis` and + * `InstructionStackEffect.maxStackGrowth`. * * NOTE 3: the implementation doesn't look at instructions that cannot be reached, it computes * the max local / stack size in the reachable code. These max's work just fine for running an diff --git a/src/compiler/scala/tools/nsc/backend/jvm/analysis/package.scala b/src/compiler/scala/tools/nsc/backend/jvm/analysis/package.scala index ef961941a0..999c686aac 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/analysis/package.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/analysis/package.scala @@ -110,7 +110,7 @@ package scala.tools.nsc.backend.jvm * - Use YourKit for finding hotspots (cpu profiling). when it comes to drilling down into the details * of a hotspot, don't pay too much attention to the percentages / time counts. * - Should also try other profilers. - * - Use timers. When a method showed up as a hotspot, i added a timer around that method, and a + * - Use timers. When a method showed up as a hotspot, I added a timer around that method, and a * second one within the method to measure specific parts. The timers slow things down, but the * relative numbers show what parts of a method are slow. * diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/BoxUnbox.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/BoxUnbox.scala index a4cd8fce1e..78fc7e1ecf 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/BoxUnbox.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/BoxUnbox.scala @@ -69,7 +69,7 @@ class BoxUnbox[BT <: BTypes](val btypes: BT) { * E1: M1 only works if there's a single boxing operation. * def e1(b: Boolean) = { * val i: Integer = box(10) // 10 is stored into a new local, box operation and i removed - * val j: Integer = box(20) // 20 is stored into a new local, box operation adn j removed + * val j: Integer = box(20) // 20 is stored into a new local, box operation and j removed * val r = if (b) i else j // loads and stores of the box are eliminated, r no longer exists * unbox(r) // cannot rewrite: we don't know which local to load * } @@ -138,7 +138,7 @@ class BoxUnbox[BT <: BTypes](val btypes: BT) { * - note that the MatchError creation is dead code: local2 is never null. However, our nullness * analysis cannot identify this: it does not track nullness through tuple stores and loads. * - if we re-write the non-escaping consumers of the outer tuple, but keep the tuple allocation - * and the escaping consumer, we get the follwoing: + * and the escaping consumer, we get the following: * * load 1, load 2 * val newLocal1 = new Tuple2; load newLocal1 // stack: Tuple2 @@ -188,7 +188,7 @@ class BoxUnbox[BT <: BTypes](val btypes: BT) { var maxStackGrowth = 0 - /** Mehtod M1 for eliminating box-unbox pairs (see doc comment in the beginning of this file) */ + /** Method M1 for eliminating box-unbox pairs (see doc comment in the beginning of this file) */ def replaceBoxOperationsSingleCreation(creation: BoxCreation, finalCons: Set[BoxConsumer], boxKind: BoxKind, keepBox: Boolean): Unit = { /** * If the box is eliminated, all copy operations (loads, stores, others) of the box need to diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala index 78acd72dba..f2ff73c44d 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala @@ -167,7 +167,7 @@ class ByteCodeRepository[BT <: BTypes](val classPath: ClassPath, val btypes: BT) * the users (e.g. the inliner) have to be aware of method selection. * * Note that the returned method may be abstract (ACC_ABSTRACT), native (ACC_NATIVE) or signature - * polymorphic (methods `invoke` and `invokeExact` in class `MehtodHandles`). + * polymorphic (methods `invoke` and `invokeExact` in class `MethodHandles`). * * @return The [[MethodNode]] of the requested method and the [[InternalName]] of its declaring * class, or an error message if the method could not be found. An error message is also @@ -204,8 +204,8 @@ class ByteCodeRepository[BT <: BTypes](val classPath: ClassPath, val btypes: BT) visited += i // abstract and static methods are excluded, see jvms-5.4.3.3 for (m <- findMethod(c) if !isPrivateMethod(m) && !isStaticMethod(m)) found += ((m, c)) - val recusionResult = findIn(c) - if (recusionResult.isDefined) return recusionResult + val recursionResult = findIn(c) + if (recursionResult.isDefined) return recursionResult } None } diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/CallGraph.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/CallGraph.scala index 9c0dfb0ee2..a740ca525c 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/CallGraph.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/CallGraph.scala @@ -285,7 +285,7 @@ class CallGraph[BT <: BTypes](val btypes: BT) { // final case class :: / final case object Nil // (l: List).map // can be inlined // we need to know that - // - the recevier is sealed + // - the receiver is sealed // - what are the children of the receiver // - all children are final // - none of the children overrides map diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/CopyProp.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/CopyProp.scala index b05669ce89..518646812e 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/CopyProp.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/CopyProp.scala @@ -273,7 +273,7 @@ class CopyProp[BT <: BTypes](val btypes: BT) { } /** - * Eliminate the `numArgs` inputs of the instruction `prod` (which was eliminated). Fo + * Eliminate the `numArgs` inputs of the instruction `prod` (which was eliminated). For * each input value * - if the `prod` instruction is the single consumer, enqueue the producers of the input * - otherwise, insert a POP instruction to POP the input value @@ -465,7 +465,7 @@ class CopyProp[BT <: BTypes](val btypes: BT) { } /** - * Remove `xSTORE n; xLOAD n` paris if + * Remove `xSTORE n; xLOAD n` pairs if * - the local variable n is not used anywhere else in the method (1), and * - there are no executable instructions and no live labels (jump targets) between the two (2) * diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/InlineInfoAttribute.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/InlineInfoAttribute.scala index 16ed9da0e4..7bc4ea2392 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/InlineInfoAttribute.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/InlineInfoAttribute.scala @@ -82,7 +82,7 @@ case class InlineInfoAttribute(inlineInfo: InlineInfo) extends Attribute(InlineI } /** - * De-serialize the attribute into an InlineInfo. The attribute starts at cr.b(off), but we don't + * Deserialize the attribute into an InlineInfo. The attribute starts at cr.b(off), but we don't * need to access that array directly, we can use the `read` methods provided by the ClassReader. * * `buf` is a pre-allocated character array that is guaranteed to be long enough to hold any diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/Inliner.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/Inliner.scala index b9f593a4d8..0ae8347dc5 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/Inliner.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/Inliner.scala @@ -683,7 +683,7 @@ class Inliner[BT <: BTypes](val btypes: BT) { * (A2) C and D are members of the same run-time package */ def classIsAccessible(accessed: BType, from: ClassBType): Either[OptimizerWarning, Boolean] = (accessed: @unchecked) match { - // TODO: A2 requires "same run-time package", which seems to be package + classloader (JMVS 5.3.). is the below ok? + // TODO: A2 requires "same run-time package", which seems to be package + classloader (JVMS 5.3.). is the below ok? case c: ClassBType => c.isPublic.map(_ || c.packageInternalName == from.packageInternalName) case a: ArrayBType => classIsAccessible(a.elementType, from) case _: PrimitiveBType => Right(true) @@ -725,7 +725,7 @@ class Inliner[BT <: BTypes](val btypes: BT) { * type from there (https://github.com/scala-opt/scala/issues/13). */ def memberIsAccessible(memberFlags: Int, memberDeclClass: ClassBType, memberRefClass: ClassBType, from: ClassBType): Either[OptimizerWarning, Boolean] = { - // TODO: B3 requires "same run-time package", which seems to be package + classloader (JMVS 5.3.). is the below ok? + // TODO: B3 requires "same run-time package", which seems to be package + classloader (JVMS 5.3.). is the below ok? def samePackageAsDestination = memberDeclClass.packageInternalName == from.packageInternalName def targetObjectConformsToDestinationClass = false // needs type propagation analysis, see above diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/InlinerHeuristics.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/InlinerHeuristics.scala index 4744cb9ab1..63360e17ff 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/InlinerHeuristics.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/InlinerHeuristics.scala @@ -125,7 +125,7 @@ class InlinerHeuristics[BT <: BTypes](val bTypes: BT) { if (callsite.isInlineAnnotated && callee.canInlineFromSource) { // By default, we only emit inliner warnings for methods annotated @inline. However, we don't // want to be unnecessarily noisy with `-opt-warnings:_`: for example, the inliner heuristic - // would attempty to inline `Function1.apply$sp$II`, as it's higher-order (the receiver is + // would attempt to inline `Function1.apply$sp$II`, as it's higher-order (the receiver is // a function), and it's concrete (forwards to `apply`). But because it's non-final, it cannot // be inlined. So we only create warnings here for methods annotated @inline. Some(Left(CalleeNotFinal( diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala index 65d1e20d69..9c22b09cdd 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala @@ -61,7 +61,7 @@ import scala.tools.nsc.backend.jvm.opt.BytecodeUtils._ * - empty local variable descriptors (local variables that were holding the box may become unused) * * copy propagation (replaces LOAD n to the LOAD m for the smallest m that is an alias of n) - * + enables downstrem: + * + enables downstream: * - stale stores (a stored value may not be loaded anymore) * - store-load pairs (a load n may now be right after a store n) * + NOTE: copy propagation is only executed once, in the first fixpoint loop iteration. none of diff --git a/src/compiler/scala/tools/nsc/classpath/DirectoryClassPath.scala b/src/compiler/scala/tools/nsc/classpath/DirectoryClassPath.scala index 133a656206..1ea152b29c 100644 --- a/src/compiler/scala/tools/nsc/classpath/DirectoryClassPath.scala +++ b/src/compiler/scala/tools/nsc/classpath/DirectoryClassPath.scala @@ -106,7 +106,7 @@ trait JFileDirectoryLookup[FileEntryType <: ClassRepresentation] extends Directo // as the type of `case class C(); case class D(); List(C(), D()).head`, rather than the opposite order. // On Mac, the HFS performs this sorting transparently, but on Linux the order is unspecified. // - // Note this behaviour can be enabled with in javac with `javac -XDsortfiles`, but that's only + // Note this behaviour can be enabled in javac with `javac -XDsortfiles`, but that's only // intended to improve determinism of the compiler for compiler hackers. util.Arrays.sort(listing, (o1: File, o2: File) => o1.getName.compareTo(o2.getName)) listing diff --git a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala index 947af55724..3ef75679ee 100644 --- a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala +++ b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala @@ -276,7 +276,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners { // SelectFromTypeTree otherwise. See #3567. // Select nodes can be later // converted in the typechecker to SelectFromTypeTree if the class - // turns out to be an instance ionner class instead of a static inner class. + // turns out to be an instance inner class instead of a static inner class. def typeSelect(t: Tree, name: Name) = t match { case Ident(_) | Select(_, _) => Select(t, name) case _ => SelectFromTypeTree(t, name.toTypeName) diff --git a/src/compiler/scala/tools/nsc/transform/AccessorSynthesis.scala b/src/compiler/scala/tools/nsc/transform/AccessorSynthesis.scala index a0bba46398..e027b065ac 100644 --- a/src/compiler/scala/tools/nsc/transform/AccessorSynthesis.scala +++ b/src/compiler/scala/tools/nsc/transform/AccessorSynthesis.scala @@ -99,7 +99,7 @@ trait AccessorSynthesis extends Transform with ast.TreeDSL { } - // TODO: better way to communicate from info transform to tree transfor? + // TODO: better way to communicate from info transform to tree transform? private[this] val _bitmapInfo = perRunCaches.newMap[Symbol, BitmapInfo] private[this] val _slowPathFor = perRunCaches.newMap[Symbol, Symbol]() diff --git a/src/compiler/scala/tools/nsc/transform/Delambdafy.scala b/src/compiler/scala/tools/nsc/transform/Delambdafy.scala index 855e53710b..2e7ab8a887 100644 --- a/src/compiler/scala/tools/nsc/transform/Delambdafy.scala +++ b/src/compiler/scala/tools/nsc/transform/Delambdafy.scala @@ -152,7 +152,7 @@ abstract class Delambdafy extends Transform with TypingTransformers with ast.Tre val resTpOk = ( samResultType =:= UnitTpe || functionResultType =:= samResultType - || (isReferenceType(samResultType) && isReferenceType(functionResultType))) // yes, this is what the spec says -- no further correspondance required + || (isReferenceType(samResultType) && isReferenceType(functionResultType))) // yes, this is what the spec says -- no further correspondence required if (resTpOk && (samParamTypes corresponds functionParamTypes){ (samParamTp, funParamTp) => funParamTp =:= samParamTp || (isReferenceType(funParamTp) && isReferenceType(samParamTp) && funParamTp <:< samParamTp) }) target else { @@ -165,7 +165,7 @@ abstract class Delambdafy extends Transform with TypingTransformers with ast.Tre // whenever a type in the sam's signature is (erases to) a primitive type, we must pick the sam's version, // as we don't implement the logic regarding widening that's performed by LMF -- we require =:= for primitives // - // We use the sam's type for the check whether we're dealin with a reference type, as it could be a generic type, + // We use the sam's type for the check whether we're dealing with a reference type, as it could be a generic type, // which means the function's parameter -- even if it expects a value class -- will need to be // boxed on the generic call to the sam method. diff --git a/src/compiler/scala/tools/nsc/transform/Fields.scala b/src/compiler/scala/tools/nsc/transform/Fields.scala index fbf1e8cec1..b2bf9fad3f 100644 --- a/src/compiler/scala/tools/nsc/transform/Fields.scala +++ b/src/compiler/scala/tools/nsc/transform/Fields.scala @@ -58,7 +58,7 @@ import symtab.Flags._ * * In the even longer term (Scala 3?), I agree with @DarkDimius that it would make sense * to hide the difference between strict and lazy vals. All vals are lazy, - * but the memoization overhead is removed when we statically know they are forced during initialiation. + * but the memoization overhead is removed when we statically know they are forced during initialization. * We could still expose the low-level field semantics through `private[this] val`s. * * In any case, the current behavior of overriding vals is pretty surprising. diff --git a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala index 798cfcd072..169fe7588e 100644 --- a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala +++ b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala @@ -113,7 +113,7 @@ abstract class LambdaLift extends InfoTransform { * * For DelayedInit subclasses, constructor statements end up in the synthetic init method * instead of the constructor itself, so the access should go to the field. This method changes - * `logicallyEnclosingMember` in this case to return a temprorary symbol corresponding to that + * `logicallyEnclosingMember` in this case to return a temporary symbol corresponding to that * method. */ private def logicallyEnclosingMember(sym: Symbol): Symbol = { diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala index de0db51b6c..96e2135c52 100644 --- a/src/compiler/scala/tools/nsc/transform/Mixin.scala +++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala @@ -32,7 +32,7 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL with AccessorSynthes * we cannot emit PROTECTED methods in interfaces on the JVM, * but knowing that these trait methods are protected means we won't emit static forwarders. * - * JVMLS: "Methods of interfaces may have any of the flags in Table 4.6-A set + * JVMS: "Methods of interfaces may have any of the flags in Table 4.6-A set * except ACC_PROTECTED, ACC_FINAL, ACC_SYNCHRONIZED, and ACC_NATIVE (JLS ยง9.4)." * * TODO: can we just set the right flags from the start?? @@ -137,7 +137,7 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL with AccessorSynthes */ def addMember(clazz: Symbol, member: Symbol): Symbol = { debuglog(s"mixing into $clazz: ${member.defString}") - // This attachment is used to instruct the backend about which methids in traits require + // This attachment is used to instruct the backend about which methods in traits require // a static trait impl method. We remove this from the new symbol created for the method // mixed into the subclass. member.removeAttachment[NeedStaticImpl.type] diff --git a/src/compiler/scala/tools/nsc/transform/SampleTransform.scala b/src/compiler/scala/tools/nsc/transform/SampleTransform.scala index ba303f7c2b..4c1705e386 100644 --- a/src/compiler/scala/tools/nsc/transform/SampleTransform.scala +++ b/src/compiler/scala/tools/nsc/transform/SampleTransform.scala @@ -35,7 +35,7 @@ abstract class SampleTransform extends Transform { atPos(tree1.pos)( // `atPos` fills in position of its tree argument Select( // The `Select` factory method is defined in class `Trees` sup, - currentOwner.newValue( // creates a new term symbol owned by `currentowner` + currentOwner.newValue( // creates a new term symbol owned by `currentOwner` newTermName("sample"), // The standard term name creator tree1.pos))))) case _ => diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala index 84f47c1caa..9161786d76 100644 --- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala +++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala @@ -1992,7 +1992,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { else exitingSpecialize(specializeCalls(unit).transform(tree)) // Remove the final modifier and @inline annotation from anything in the - // original class (since it's being overridden in at least onesubclass). + // original class (since it's being overridden in at least one subclass). // // We do this here so that the specialized subclasses will correctly copy // final and @inline. diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index 096b6b9263..dcffd7a6ab 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -363,7 +363,7 @@ abstract class UnCurry extends InfoTransform * mark the method symbol SYNCHRONIZED for bytecode generation. * * Delambdafy targets are deemed ineligible as the Delambdafy phase will - * replace `this.synchronized` with `$this.synchronzed` now that it emits + * replace `this.synchronized` with `$this.synchronized` now that it emits * all lambda impl methods as static. */ private def translateSynchronized(tree: Tree) = tree match { @@ -705,7 +705,7 @@ abstract class UnCurry extends InfoTransform // // So what we need to do is to use the pre-uncurry type when creating `l$1`, which is `c.Tree` and is // correct. Now, there are two additional problems: - // 1. when varargs and byname params are involved, the uncurry transformation desugares these special + // 1. when varargs and byname params are involved, the uncurry transformation desugars these special // cases to actual typerefs, eg: // ``` // T* ~> Seq[T] (Scala-defined varargs) diff --git a/src/compiler/scala/tools/nsc/transform/patmat/Logic.scala b/src/compiler/scala/tools/nsc/transform/patmat/Logic.scala index cb3759e5fa..db6eac34cb 100644 --- a/src/compiler/scala/tools/nsc/transform/patmat/Logic.scala +++ b/src/compiler/scala/tools/nsc/transform/patmat/Logic.scala @@ -184,8 +184,8 @@ trait Logic extends Debugging { // push negation inside formula def negationNormalFormNot(p: Prop): Prop = p match { - case And(ops) => Or(ops.map(negationNormalFormNot)) // De'Morgan - case Or(ops) => And(ops.map(negationNormalFormNot)) // De'Morgan + case And(ops) => Or(ops.map(negationNormalFormNot)) // De Morgan + case Or(ops) => And(ops.map(negationNormalFormNot)) // De Morgan case Not(p) => negationNormalForm(p) case True => False case False => True diff --git a/src/compiler/scala/tools/nsc/transform/patmat/MatchTreeMaking.scala b/src/compiler/scala/tools/nsc/transform/patmat/MatchTreeMaking.scala index 89c793ec94..794d3d442a 100644 --- a/src/compiler/scala/tools/nsc/transform/patmat/MatchTreeMaking.scala +++ b/src/compiler/scala/tools/nsc/transform/patmat/MatchTreeMaking.scala @@ -564,11 +564,11 @@ trait MatchTreeMaking extends MatchCodeGen with Debugging { else scrut match { case Typed(tree, tpt) => val suppressExhaustive = tpt.tpe hasAnnotation UncheckedClass - val supressUnreachable = tree match { + val suppressUnreachable = tree match { case Ident(name) if name startsWith nme.CHECK_IF_REFUTABLE_STRING => true // SI-7183 don't warn for withFilter's that turn out to be irrefutable. case _ => false } - val suppression = Suppression(suppressExhaustive, supressUnreachable) + val suppression = Suppression(suppressExhaustive, suppressUnreachable) val hasSwitchAnnotation = treeInfo.isSwitchAnnotation(tpt.tpe) // matches with two or fewer cases need not apply for switchiness (if-then-else will do) // `case 1 | 2` is considered as two cases. diff --git a/src/compiler/scala/tools/nsc/util/package.scala b/src/compiler/scala/tools/nsc/util/package.scala index bd95fdbb50..80e82c85d8 100644 --- a/src/compiler/scala/tools/nsc/util/package.scala +++ b/src/compiler/scala/tools/nsc/util/package.scala @@ -89,7 +89,7 @@ package object util { implicit class StackTraceOps(private val e: Throwable) extends AnyVal with StackTracing { /** Format the stack trace, returning the prefix consisting of frames that satisfy * a given predicate. - * The format is similar to the typical case described in the JavaDoc + * The format is similar to the typical case described in the Javadoc * for [[java.lang.Throwable#printStackTrace]]. * If a stack trace is truncated, it will be followed by a line of the form * `... 3 elided`, by analogy to the lines `... 3 more` which indicate diff --git a/src/reflect/scala/reflect/internal/Definitions.scala b/src/reflect/scala/reflect/internal/Definitions.scala index 19460af27f..704b761746 100644 --- a/src/reflect/scala/reflect/internal/Definitions.scala +++ b/src/reflect/scala/reflect/internal/Definitions.scala @@ -975,10 +975,10 @@ trait Definitions extends api.StandardDefinitions { } /** Given a class symbol C with type parameters T1, T2, ... Tn - * which have upper/lower bounds LB1/UB1, LB1/UB2, ..., LBn/UBn, + * which have upper/lower bounds LB1/UB1, LB2/UB2, ..., LBn/UBn, * returns an existential type of the form * - * C[E1, ..., En] forSome { E1 >: LB1 <: UB1 ... en >: LBn <: UBn }. + * C[E1, ..., En] forSome { E1 >: LB1 <: UB1 ... En >: LBn <: UBn }. */ // TODO Review the way this is used. I see two potential problems: // 1. `existentialAbstraction` here doesn't create fresh existential type symbols, it just diff --git a/src/reflect/scala/reflect/internal/Positions.scala b/src/reflect/scala/reflect/internal/Positions.scala index 95b3b7fb14..1a1aa2e721 100644 --- a/src/reflect/scala/reflect/internal/Positions.scala +++ b/src/reflect/scala/reflect/internal/Positions.scala @@ -255,7 +255,7 @@ trait Positions extends api.Positions { self: SymbolTable => val annTrees = mdef.mods.annotations match { case Nil if mdef.symbol != null => // After typechecking, annotations are moved from the modifiers - // to the annotation on the symbol of the anotatee. + // to the annotation on the symbol of the annotatee. mdef.symbol.annotations.map(_.original) case anns => anns } diff --git a/src/reflect/scala/reflect/internal/Scopes.scala b/src/reflect/scala/reflect/internal/Scopes.scala index 19804fc5f3..51fb31d36d 100644 --- a/src/reflect/scala/reflect/internal/Scopes.scala +++ b/src/reflect/scala/reflect/internal/Scopes.scala @@ -298,7 +298,7 @@ trait Scopes extends api.Scopes { self: SymbolTable => var e = lookupEntry(original.name.companionName) while (e != null) { // 1) Must be owned by the same Scope, to ensure that in - // `{ class C; { ...; object C } }`, the class is not seen as a comaniopn of the object. + // `{ class C; { ...; object C } }`, the class is not seen as a companion of the object. // 2) Must be a class and module symbol, so that `{ class C; def C }` or `{ type T; object T }` are not companions. def isClassAndModule(sym1: Symbol, sym2: Symbol) = sym1.isClass && sym2.isModule if ((e.owner eq entry.owner) && (isClassAndModule(original, e.sym) || isClassAndModule(e.sym, original))) { diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala index ad7e3ffe8f..93dbe37664 100644 --- a/src/reflect/scala/reflect/internal/Types.scala +++ b/src/reflect/scala/reflect/internal/Types.scala @@ -4152,7 +4152,7 @@ trait Types * The specification-enumerated non-value types are method types, polymorphic * method types, and type constructors. Supplements to the specified set of * non-value types include: types which wrap non-value symbols (packages - * abd statics), overloaded types. Varargs and by-name types T* and (=>T) are + * and statics), overloaded types. Varargs and by-name types T* and (=>T) are * not designated non-value types because there is code which depends on using * them as type arguments, but their precise status is unclear. */ @@ -4251,7 +4251,7 @@ trait Types case mt1 @ MethodType(params1, res1) => tp2 match { case mt2 @ MethodType(params2, res2) => - // sameLength(params1, params2) was used directly as pre-screening optimization (now done by matchesQuantified -- is that ok, performancewise?) + // sameLength(params1, params2) was used directly as pre-screening optimization (now done by matchesQuantified -- is that ok, performance-wise?) mt1.isImplicit == mt2.isImplicit && matchingParams(params1, params2, mt1.isJava, mt2.isJava) && matchesQuantified(params1, params2, res1, res2) @@ -4696,7 +4696,7 @@ trait Types case _ => Depth(1) } - //OPT replaced with tailrecursive function to save on #closures + //OPT replaced with tail recursive function to save on #closures // was: // var d = 0 // for (tp <- tps) d = d max by(tp) //!!!OPT!!! diff --git a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala index fe1de91662..08ccac8069 100644 --- a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala +++ b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala @@ -385,7 +385,7 @@ abstract class UnPickler { // We're stuck with the order types are pickled in, but with judicious use // of named parameters we can recapture a declarative flavor in a few cases. - // But it's still a rat's nest of adhockery. + // But it's still a rat's nest of ad-hockery. (tag: @switch) match { case NOtpe => NoType case NOPREFIXtpe => NoPrefix diff --git a/src/reflect/scala/reflect/internal/tpe/GlbLubs.scala b/src/reflect/scala/reflect/internal/tpe/GlbLubs.scala index 108ce45cca..6d9a9d6649 100644 --- a/src/reflect/scala/reflect/internal/tpe/GlbLubs.scala +++ b/src/reflect/scala/reflect/internal/tpe/GlbLubs.scala @@ -136,7 +136,7 @@ private[internal] trait GlbLubs { mergePrefixAndArgs(ts1, Covariant, depth) match { case NoType => loop(pretypes, tails) case tp if strictInference && willViolateRecursiveBounds(tp, ts0, ts1) => - log(s"Breaking recursion in lublist, advancing frontier and discaring merged prefix/args from $tp") + log(s"Breaking recursion in lublist, advancing frontier and discarding merged prefix/args from $tp") loop(pretypes, tails) case tp => loop(tp :: pretypes, tails) diff --git a/src/reflect/scala/reflect/internal/tpe/TypeComparers.scala b/src/reflect/scala/reflect/internal/tpe/TypeComparers.scala index cf274f24bb..990092b749 100644 --- a/src/reflect/scala/reflect/internal/tpe/TypeComparers.scala +++ b/src/reflect/scala/reflect/internal/tpe/TypeComparers.scala @@ -404,7 +404,7 @@ trait TypeComparers { sym2.isClass && { val base = tr1 baseType sym2 // During bootstrap, `base eq NoType` occurs about 2.5 times as often as `base ne NoType`. - // The extra check seems like a worthwhile optimization (about 2.5M useless calls to isSubtype saved during that run). + // The extra check seems like a worthwhile optimization (about 2.5M useless calls to isSubType saved during that run). (base ne tr1) && (base ne NoType) && isSubType(base, tr2, depth) } || diff --git a/src/reflect/scala/reflect/internal/tpe/TypeConstraints.scala b/src/reflect/scala/reflect/internal/tpe/TypeConstraints.scala index e321a07f51..2697824fd5 100644 --- a/src/reflect/scala/reflect/internal/tpe/TypeConstraints.scala +++ b/src/reflect/scala/reflect/internal/tpe/TypeConstraints.scala @@ -25,7 +25,7 @@ private[internal] trait TypeConstraints { // register with the auto-clearing cache manager perRunCaches.recordCache(this) - /** Undo all changes to constraints to type variables upto `limit`. */ + /** Undo all changes to constraints to type variables up to `limit`. */ //OPT this method is public so we can do `manual inlining` def undoTo(limit: UndoPairs) { assertCorrectThread() diff --git a/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala b/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala index de065d0b5d..0601067d26 100644 --- a/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala +++ b/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala @@ -312,7 +312,7 @@ private[internal] trait TypeMaps { * the corresponding class file might still not be read, so we do not * know what the type parameters of the type are. Therefore * the conversion of raw types to existential types might not have taken place - * in ClassFileparser.sigToType (where it is usually done). + * in ClassFileParser.sigToType (where it is usually done). */ def rawToExistential = new TypeMap { private var expanded = immutable.Set[Symbol]() @@ -404,7 +404,7 @@ private[internal] trait TypeMaps { case _ => super.mapOver(tp) } - // Do not discard the types of existential ident's. The + // Do not discard the types of existential idents. The // symbol of the Ident itself cannot be listed in the // existential's parameters, so the resulting existential // type would be ill-formed. @@ -504,7 +504,7 @@ private[internal] trait TypeMaps { && isBaseClassOfEnclosingClass(sym.owner) ) - private var capturedThisIds= 0 + private var capturedThisIds = 0 private def nextCapturedThisId() = { capturedThisIds += 1; capturedThisIds } /** Creates an existential representing a type parameter which appears * in the prefix of a ThisType. diff --git a/src/reflect/scala/reflect/internal/transform/Erasure.scala b/src/reflect/scala/reflect/internal/transform/Erasure.scala index e2f1e74740..24f8aa88e6 100644 --- a/src/reflect/scala/reflect/internal/transform/Erasure.scala +++ b/src/reflect/scala/reflect/internal/transform/Erasure.scala @@ -19,7 +19,7 @@ trait Erasure { /* A Java Array is erased to Array[Object] (T can only be a reference type), where as a Scala Array[T] is * erased to Object. However, there is only symbol for the Array class. So to make the distinction between * a Java and a Scala array, we check if the owner of T comes from a Java class. - * This however caused issue SI-5654. The additional test for EXSITENTIAL fixes it, see the ticket comments. + * This however caused issue SI-5654. The additional test for EXISTENTIAL fixes it, see the ticket comments. * In short, members of an existential type (e.g. `T` in `forSome { type T }`) can have pretty arbitrary * owners (e.g. when computing lubs, is used). All packageClass symbols have `isJavaDefined == true`. */ diff --git a/src/reflect/scala/reflect/internal/util/Statistics.scala b/src/reflect/scala/reflect/internal/util/Statistics.scala index 905f1bf26e..2d623f3367 100644 --- a/src/reflect/scala/reflect/internal/util/Statistics.scala +++ b/src/reflect/scala/reflect/internal/util/Statistics.scala @@ -78,7 +78,7 @@ object Statistics { /** Create a new stackable that shows as `prefix` and is active * in the same phases as its base timer. Stackable timers are subtimers - * that can be stacked ina timerstack, and that print aggregate, as well as specific + * that can be stacked in a timerstack, and that print aggregate, as well as specific * durations. */ def newStackableTimer(prefix: String, timer: Timer): StackableTimer = new StackableTimer(prefix, timer) diff --git a/src/reflect/scala/reflect/macros/blackbox/Context.scala b/src/reflect/scala/reflect/macros/blackbox/Context.scala index ce28b5911e..205e3ad1c3 100644 --- a/src/reflect/scala/reflect/macros/blackbox/Context.scala +++ b/src/reflect/scala/reflect/macros/blackbox/Context.scala @@ -26,7 +26,7 @@ package blackbox * Refer to the documentation of top-level traits in this package to learn the details. * * If a macro def refers to a macro impl that uses `blackbox.Context`, then this macro def becomes a blackbox macro, - * which means that its expansion will be upcast to its return type, enforcing faithfullness of that macro to its + * which means that its expansion will be upcast to its return type, enforcing faithfulness of that macro to its * type signature. Whitebox macros, i.e. the ones defined with `whitebox.Context`, aren't bound by this restriction, * which enables a number of important use cases, but they are also going to enjoy less support than blackbox macros, * so choose wisely. See the [[http://docs.scala-lang.org/overviews/macros/overview.html Macros Guide]] for more information. -- cgit v1.2.3