summaryrefslogtreecommitdiff
path: root/test/files
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #5761 from lrytz/sd329Adriaan Moors2017-03-102-2/+78
|\ | | | | Don't use `equals` for comparing java.lang.Double/Float
| * Don't use `equals` for comparing java.lang.Double/FloatLukas Rytz2017-03-092-2/+78
| | | | | | | | | | | | | | Fixes https://github.com/scala/scala-dev/issues/329 The `equals` method for java.lang.Double/Float behaves differently than comparing the `doubleValue`s / `floatValues` for `-0.0`/`0.0`/`NaN`.
* | SI-8969 Accept poly+implicit for assignment syntaxSom Snytt2017-03-091-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Follow-up to fb061f22d4c35df626d9651e017820a11f8fe56e which allowed the type param only. Reported: ``` scala> object Test { | def a[R](implicit s: List[R]):Int = 0 | def a_=[R](v: Int)(implicit s: List[R]) = () | } ```
* | Merge pull request #5671 from retronym/topic/stubby-2Lukas Rytz2017-03-031-0/+59
|\ \ | | | | | | Avoid compiler crash with missing transitive dependencies
| * | Avoid stub symbol related crash in backendJason Zaugg2017-02-191-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this test case, the backend forces the specialization info transform of `Sub` during computation of its inner class metadata. This in turn runs the info transforms of the `Base`. This leads to the uncurry info tranform transforming a signature that has a type alias as a method parameter type. Subsequent substution of the new method symbol into the result type, which includes a stub symbol for an absent class, tripped an assertion: ``` requirement failed: package b java.lang.IllegalArgumentException: requirement failed: package b at scala.Predef$.require(Predef.scala:277) at scala.reflect.internal.Types$ModuleTypeRef.<init>(Types.scala:1879) at scala.reflect.internal.Types$PackageTypeRef.<init>(Types.scala:1897) at scala.reflect.internal.Types$TypeRef$.apply(Types.scala:2401) at scala.reflect.internal.Types.typeRef(Types.scala:3553) at scala.reflect.internal.Types.typeRef$(Types.scala:3536) at scala.reflect.internal.SymbolTable.typeRef(SymbolTable.scala:16) at scala.reflect.internal.Symbols$TypeSymbol.newTypeRef(Symbols.scala:3026) at scala.reflect.internal.Symbols$TypeSymbol.updateTypeCache(Symbols.scala:3079) at scala.reflect.internal.Symbols$TypeSymbol.maybeUpdateTypeCache(Symbols.scala:3065) at scala.reflect.internal.Symbols$TypeSymbol.tpe_$times(Symbols.scala:3043) at scala.reflect.internal.Symbols$Symbol.typeOfThis(Symbols.scala:2020) at scala.reflect.internal.Types$ThisType.underlying(Types.scala:1184) at scala.reflect.internal.Types$SimpleTypeProxy.boundSyms(Types.scala:150) at scala.reflect.internal.Types$SimpleTypeProxy.boundSyms$(Types.scala:150) at scala.reflect.internal.Types$SingletonType.boundSyms(Types.scala:1088) at scala.reflect.internal.tpe.TypeMaps$SubstMap.apply(TypeMaps.scala:726) at scala.reflect.internal.tpe.TypeMaps$SubstSymMap.apply(TypeMaps.scala:789) at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:102) at scala.reflect.internal.tpe.TypeMaps$SubstSymMap.apply(TypeMaps.scala:783) at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:102) at scala.reflect.internal.tpe.TypeMaps$SubstSymMap.apply(TypeMaps.scala:783) at scala.reflect.internal.Types$Type.substSym(Types.scala:727) at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:123) at scala.reflect.internal.transform.UnCurry$$anon$1.apply(UnCurry.scala:53) at scala.reflect.internal.transform.UnCurry.transformInfo(UnCurry.scala:154) ``` This commit address the direct failure above by setting coherent flags on the stub package class symbol (it also needs the MODULE flag).
* | | Merge pull request #5622 from edmundnoble/extra-errsAdriaan Moors2017-03-023-8/+8
|\ \ \ | |_|/ |/| | Improved error messages for identically named, differently prefixed types
| * | Match error lengthsEdmund Noble2017-02-071-1/+1
| | |
| * | Improved error messages for identically named, differently prefixed typesEdmund Noble2016-12-313-8/+8
| | |
* | | SI-10207 Error before update conversionSom Snytt2017-02-262-0/+20
| | | | | | | | | | | | | | | | | | Gaze deeper for errors before committing to conversion of assignment to update. The error buried in the transformed tree escapes notice of retypechecking and leaks to backend.
* | | Revert "Fix erasure of the qualifier of ##"Adriaan Moors2017-02-222-17/+0
| | |
* | | Revert "SI-10133 Require escaped single quote char lit"Adriaan Moors2017-02-2111-43/+16
| | |
* | | Merge pull request #5658 from retronym/topic/hashhashLukas Rytz2017-02-212-0/+17
|\ \ \ | | | | | | | | Fix erasure of the qualifier of ##
| * | | Fix erasure of the qualifier of ##Jason Zaugg2017-01-242-0/+17
| |/ /
* | | Merge pull request #5708 from szeiger/issue/si10194Lukas Rytz2017-02-211-0/+15
|\ \ \ | | | | | | | | SI-10194: Fix abstract type resolution for overloaded HOFs
| * | | SI-10194: Fix abstract type resolution for overloaded HOFsStefan Zeiger2017-02-211-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | Types in the applicable overload alternatives need to be seen from the respective owners of the individual alternative, not from the target’s owner (which can be a subtype of the types that define the methods).
* | | | Merge pull request #5704 from som-snytt/issue/10190-elide-stringLukas Rytz2017-02-213-14/+32
|\ \ \ \ | | | | | | | | | | SI-10190 Elide string to empty instead of null
| * | | | SI-10190 Elide string to empty instead of nullSom Snytt2017-02-153-14/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid NPE when eliding string-valued functions. For example, `log(s"$cheap$expensive")` needn't print null. This is a natural and inexpensive way to elide strings.
* | | | | Merge pull request #5640 from optimizely/repl-import-handlerAdriaan Moors2017-02-202-0/+65
|\ \ \ \ \ | | | | | | | | | | | | SI-9881 Fix ImportHandler's reporting of importedNames and importedSymbols
| * | | | | Fix ImportHandler's reporting of importedNames and importedSymbolsHao Xia2017-01-112-0/+65
| | |_|/ / | |/| | |
* | | | | Merge pull request #5629 from som-snytt/issue/10120-quote-errAdriaan Moors2017-02-2011-16/+43
|\ \ \ \ \ | | | | | | | | | | | | SI-10133 Require escaped single quote char lit
| * | | | | SI-10120 ReplReporter handles message indentSom Snytt2017-01-188-14/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of indenting source code to make messages align on output, let the reporter add indentation, only if the source is the console (and not a pastie or a loaded file). Previously, syntax errors were not indented. ``` $ skala Welcome to Scala 2.12.2-20170108-010722-939abf1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111). Type in expressions for evaluation. Or try :help. scala> 'abc' <console>:1: error: unclosed character literal (or use " for string literal "abc") 'abc' ^ scala> :quit $ scala Welcome to Scala 2.12.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111). Type in expressions for evaluation. Or try :help. scala> 'abc' <console>:1: error: unclosed character literal 'abc' ^ ```
| * | | | | SI-10120 Extra advice on unclosed char literalSom Snytt2017-01-083-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Folks from other languages might mistakenly enclose a string in single quotes. Since this presents as a symbol literal followed by the unpaired single quote, we can add a syntax reminder. Also polish the wording for bad string interpolation.
| * | | | | SI-10133 Require escaped single quote char litSom Snytt2017-01-082-1/+8
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | The spec specifically requires `'\''` and not `'''`. The error consumes all consecutive single quotes.
* | | | | Merge pull request #5659 from retronym/ticket/10026Adriaan Moors2017-02-202-0/+12
|\ \ \ \ \ | | | | | | | | | | | | SI-10026 Fix endless cycle in runtime reflection
| * | | | | SI-10026 Fix endless cycle in runtime reflectionJason Zaugg2017-02-192-0/+12
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 56f23af introduced a call to `baseTypeSeq` of `scala.collection.mutable.ArrayOps.ofRef[?T]{}` in `findMember`. This exposed a latent bug in the synchronized wrapper of `BaseTypeSeq`, demonstrated below with an older version of Scala: ``` Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_112). Type in expressions for evaluation. Or try :help. scala> val symtab = reflect.runtime.universe.asInstanceOf[scala.reflect.internal.SymbolTable] symtab: scala.reflect.internal.SymbolTable = scala.reflect.runtime.JavaUniverse@458544e0 scala> import symtab._ import symtab._ scala> val ArrayOps_ofRef_Class = symtab.symbolOf[scala.collection.mutable.ArrayOps.ofRef[AnyRef]] ArrayOps_ofRef_Class: symtab.TypeSymbol = class ofRef scala> appliedType(symbolOf[Set[Any]], symbolOf[Set[Any]].typeParams.map(TypeVar(_))) res2: symtab.Type = Set[?A] scala> .narrow res3: symtab.Type = <none>.<refinement>.type scala> .baseTypeSeq java.lang.StackOverflowError at scala.reflect.runtime.Gil$class.gilSynchronized(Gil.scala:21) at scala.reflect.runtime.JavaUniverse.gilSynchronized(JavaUniverse.scala:16) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$class.map(SynchronizedOps.scala:27) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.map(SynchronizedOps.scala:34) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$class.lateMap(SynchronizedOps.scala:34) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.lateMap(SynchronizedOps.scala:34) at scala.reflect.internal.BaseTypeSeqs$MappedBaseTypeSeq.map(BaseTypeSeqs.scala:235) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.scala$reflect$runtime$SynchronizedOps$SynchronizedBaseTypeSeq$$super$map(SynchronizedOps.scala:34) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anonfun$map$1.apply(SynchronizedOps.scala:27) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anonfun$map$1.apply(SynchronizedOps.scala:27) at scala.reflect.runtime.Gil$class.gilSynchronized(Gil.scala:19) at scala.reflect.runtime.JavaUniverse.gilSynchronized(JavaUniverse.scala:16) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$class.map(SynchronizedOps.scala:27) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.map(SynchronizedOps.scala:34) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$class.lateMap(SynchronizedOps.scala:34) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.lateMap(SynchronizedOps.scala:34) at scala.reflect.internal.BaseTypeSeqs$MappedBaseTypeSeq.map(BaseTypeSeqs.scala:235) ``` The infinite cycle involves: ``` class MappedBaseTypeSeq(orig: BaseTypeSeq, f: Type => Type) extends BaseTypeSeq(orig.parents map f, orig.elems) { ... override def map(g: Type => Type) = lateMap(g) override def lateMap(g: Type => Type) = orig.lateMap(x => g(f(x))) } trait SynchronizedBaseTypeSeq extends BaseTypeSeq { ... override def map(f: Type => Type): BaseTypeSeq = gilSynchronized { super.map(f) } override def lateMap(f: Type => Type): BaseTypeSeq = // only need to synchronize BaseTypeSeqs if they contain refined types if (map(f).toList.exists(_.isInstanceOf[RefinedType])) new MappedBaseTypeSeq(this, f) with SynchronizedBaseTypeSeq else new MappedBaseTypeSeq(this, f) } ``` This commit creates a new factory method for `MappedBaseTypeSeq`-s to break the cycle. As an independent change, I have also removed the attempt to conditionally synchronize them, as the condition was eagerly applying the map function (and throwing away the result!). I've appeased MiMa with new whitelist entries, but I'm confident that this is deep enough in the bowels of our runtime reflection implementation that there is no way that user code will be calling these methods directly.
* | | | | Ignore BoundedWildcardType in erasure type mapAdriaan Moors2017-02-191-0/+11
| | | | | | | | | | | | | | | | | | | | This case can be triggered as illustrated in the test.
* | | | | SI-10148 Accept verbose zeroSom Snytt2017-02-181-1/+9
|/ / / / | | | | | | | | | | | | The test for non-zero must recognize `-0e+00f` and variants.
* | | | Merge branch '2.12.x' into merge-2.11.x-to-2.12.x-20170214Seth Tisue2017-02-1716-3/+274
|\ \ \ \ | | |_|/ | |/| |
| * | | Merge pull request #5648 from som-snytt/issue/10148Seth Tisue2017-02-163-2/+30
| |\ \ \ | | | | | | | | | | SI-10148 Follow Java for float literals
| | * | | SI-10148 Follow Java for float literalsSom Snytt2017-01-183-2/+30
| | |/ / | | | | | | | | | | | | | | | | Use `Float.parseFloat` instead of converting from Double. Error when a value rounds to zero.
| * | | Merge pull request #5589 from allisonhb/feature/si-4700Adriaan Moors2017-02-162-0/+66
| |\ \ \ | | | | | | | | | | SI-4700 The thrilling continuation to the infix type printing saga.
| | * | | SI-4700 Make infix notation default for symbolic types.allisonhb2016-12-142-21/+17
| | | | | | | | | | | | | | | | | | | | Add ability to disable this via the @showAsInfix annotation.
| | * | | SI-4700 Show infix types with as few parentheses as needed.allisonhb2016-12-132-0/+20
| | | | |
| | * | | SI-4700 Add `@infix` annotation for type printingVlad Ureche2016-09-192-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` scala> import scala.annotation.infix import scala.annotation.infix scala> @infix class &&[T, U] defined class $amp$amp scala> def foo: Int && Boolean = ??? foo: Int && Boolean ```
| * | | | Merge pull request #5546 from som-snytt/issue/9636Adriaan Moors2017-02-164-1/+25
| |\ \ \ \ | | | | | | | | | | | | SI-9636 More precise error pos on apply inference
| | * | | | SI-9636 More precise error pos on apply inferenceSom Snytt2016-12-204-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a method type arg is inferred Any, warn about the function and not the innocent arg.
| * | | | | Merge pull request #5662 from teldosas/SI-9675Adriaan Moors2017-02-163-0/+52
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-9675 warn about non-sensible equals in anonymous functions
| | * | | | | Add warning about non-sensible equals in anonymous functionsteldosas2017-02-013-0/+52
| | | |_|/ / | | |/| | |
| * | | | | Merge pull request #5587 from lrytz/t10072Adriaan Moors2017-02-161-0/+18
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-10072 cast Function nodes to environment in specialization
| | * | | | | SI-10072 cast Function nodes to environment in specializationLukas Rytz2016-12-071-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
| * | | | | | Merge pull request #5542 from retronym/ticket/10066Adriaan Moors2017-02-163-0/+83
| |\ \ \ \ \ \ | | |_|_|_|_|/ | |/| | | | | SI-10066 Fix crash in erroneous code with implicits, dynamic
| | * | | | | SI-10066 Fix crash in erroneous code with implicits, dynamicJason Zaugg2016-11-183-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | Merge commit '0965028809' into merge-2.11.x-to-2.12.x-20170214Seth Tisue2017-02-1613-4/+107
|\ \ \ \ \ \ \
| * | | | | | | Optimised implementation of List.filter/filterNotRory Graves2017-01-281-4/+4
| | | | | | | |
| * | | | | | | SI-1459 two bridges for impl of java generic vararg methodAdriaan Moors2017-01-244-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A Scala method that implements a generic, Java-defined varargs method, needs two bridges: - to convert the collections for the repeated parameters (VBRIDGE) - to bridge the generics gap (BRIDGE) Refchecks emits the varargs "bridges", and erasure takes care of the other gap. Because a VBRIDGE was also an ARTIFACT, it was wrongly considered inert with respect to erasure, because `OverridingPairs` by default excluded artifacts. Removed the artifact flag from those VBRIDGES, so that they qualify for a real bridge. It would also work to include VBRIDGE methods that are artifacts in BridgesCursor.
| * | | | | | | SI-9013 SI-1459 Tests for inherited @varargs annotationsJason Zaugg2017-01-248-0/+78
| | | | | | | |
| * | | | | | | Merge pull request #5630 from adriaanm/rebase-5557Adriaan Moors2017-01-1014-65/+208
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | [backport] SI-10071 SI-8786 varargs methods
| | * | | | | | | [backport] SI-6412 remove flaky testSeth Tisue2017-01-091-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry-picking commit a03e7a0) I have repeatedly seen this fail CI runs, including recently as the comment in the test itself says: "I'm not sure this is a great way to test for memory leaks, since we're also testing how good the JVM's GC is, and this is not easily reproduced between machines/over time"
| | * | | | | | | SI-10071 Separate compilation for varargs methodsIulian Dragos2017-01-096-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure that methods annotated with varargs are properly mixed-in. This commit splits the transformation into an info transformer (that works on all symbols, whether they come from source or binary) and a tree transformer. The gist of this is that the symbol-creation part of the code was moved to the UnCurry info transformer, while tree operations remained in the tree transformer. The newly created symbol is attached to the original method so that the tree transformer can still retrieve the symbol. A few fall outs: - I removed a local map that was identical to TypeParamsVarargsAttachment - moved the said attachment to StdAttachments so it’s visible between reflect.internal and nsc.transform - a couple more comments in UnCurry to honour the boy-scout rule
| | * | | | | | | SI-8786 fix generic signature for @varargs forwarder methodsLukas Rytz2017-01-097-39/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When generating a varargs forwarder for def foo[T](a: T*) the parameter type of the forwarder needs to be Array[Object]. If we generate Array[T] in UnCurry, that would be erased to plain Object, and the method would not be a valid varargs. Unfortunately, setting the parameter type to Array[Object] lead to an invalid generic signature - the generic signature should reflect the real signature. This change adds an attachment to the parameter symbol in the varargs forwarder method and special-cases signature generation. Also cleans up the code to produce the varargs forwarder. For example, type parameter and parameter symbols in the forwarder's method type were not clones, but the same symbols from the original method were re-used. Backported from 0d2760dce189cdcb363e54868381175af4b2646f, with a small tweak (checkVarargs) to make the test work on Java 6, as well as later versions.