summaryrefslogtreecommitdiff
path: root/test/files/pos
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge pull request #974 from adriaanm/repull-unchecked-hkAdriaan Moors2012-07-241-1/+1
|\ \ \ | |_|/ |/| | Improve unchecked warnings.
| * | Improve unchecked warnings.Paul Phillips2012-07-231-1/+1
| | | | | | | | | | | | | | | Spurious test was not good. Better test avoids suppressing some legitimate warnings. Review by @moors.
* | | SI-4881 infer variance from formals, then resultMartin Odersky2012-07-231-0/+31
|/ / | | | | | | | | | | | | | | Changed behavior so that when determining the target variance of a method parameter, the variance in formals comes first. If variance is still undecided by that, the variance in the result type is used as a secondary criterion. (This is also done when determining prototype type params.)
* / SI-6089 test file for pt2Adriaan Moors2012-07-221-0/+18
|/ | | | test that matchEnd that's an argument of || that's in tail position is in tail position
* Merge pull request #958 from adriaanm/ticket-1832Josh Suereth2012-07-211-0/+8
|\ | | | | SI-1832 consistent symbols in casedef's pattern&body
| * SI-1832 consistent symbols in casedef's pattern&bodyAdriaan Moors2012-07-201-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the only change to typedBind in this commit (beyond refactoring to keep my eyes from bleeding), is explained by the added comment: have to imperatively set the symbol for this bind to keep it in sync with the symbols used in the body of a case when type checking a case we imperatively update the symbols in the body of the case those symbols are bound by the symbols in the Binds in the pattern of the case, so, if we set the symbols in the case body, but not in the patterns, then re-type check the casedef (for a second try in typedApply for example -- SI-1832), we are no longer in sync: the body has symbols set that do not appear in the patterns since body1 is not necessarily equal to body, we must return a copied tree, but we must still mutate the original bind
* | Merge pull request #948 from gkossakowski/target-1.6Lukas Rytz2012-07-201-2/+4
|\ \ | |/ |/| Deprecate all JVM 1.5 targets and make 1.6 default.
| * Deprecate all JVM 1.5 targets and make 1.6 default.Grzegorz Kossakowski2012-07-191-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a check if deprecated target is being used. I put that check into `checkDeprecatedSettings`. I tried to invent some general mechanism for deprecating choices in ChoiceSetting but I gave up eventually. It wasn't worth it the complexity. Also, with current approach I'm able to provide nice, customized deprecation warning. Make `jvm-1.6` a default backend. Altered test for SI-5957 because it crashes the backend. However, the problem is not with backend but with symbol creation. We get two different symbols with the same internal name and both are used in trees that reach GenASM. See SI-6109 for details. Review by @magarciaEPFL and @paulp.
* | Merge pull request #923 from scalamacros/ticket/6047Adriaan Moors2012-07-192-0/+21
|\ \ | |/ |/| test case closes SI-6047
| * test case closes SI-6047Eugene Burmako2012-07-172-0/+21
| | | | | | | | The bug is not reproducible both in M4 and in M5.
* | Merge pull request #909 from lrytz/t5892Adriaan Moors2012-07-181-0/+5
|\ \ | | | | | | SI-5892 allow implicit views in annotation args
| * | SI-5892 allow implicit views in annotation argsLukas Rytz2012-07-181-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the problem was that lazy annotations got completed in phase pickler. the `inferView` method in Typers bails out if `isPastTyper`. now the lazy annotations completes `atPhase(typerPhase)`. test case in `pos`. the second test case in `neg` is for another bug that is discussed in a comment of SI-5892. when type checking arguments of type parameter annotations, the class members should not be in scope. this was alreay fixed in 9129cfe9.
* | | Merge pull request #921 from adriaanm/ticket-spuriousnessAdriaan Moors2012-07-1814-54/+0
|\ \ \ | |_|/ |/| | move test files that fail spuriously to pending
| * | move test files that fail spuriously to pendingAdriaan Moors2012-07-1714-54/+0
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have this sneaky suspicion that part of these spurious failures are caused by the recent partest optimizations. @axel22 already checked that compiler instances are not shared between test runs. However, except for the benchmark test, they all have a distinct race condition in symbol loading/type checking feel to them. Since, in the end, the tests and/or their corresponding fixes are as likely a culprit as the test framework, moving them out of the way until their owners can get them back in line and they stop throwing primate wenches into our build. We should bring them back as soon as possible, though.
* / SI-6028 Avoid needless symbol renaming in lambdalift.Jason Zaugg2012-07-142-0/+7
|/ | | | | | | | | | Preserve names of all referenced free vars. Only the proxy symbols have the fresh names. The resulting natural beauty is evident in the diff of t6028.check. This subsumes the treatment in 0e170e4b that ensured named parameter calls cannot see mangled names; pos/t6028 confirms as much.
* SI-5957 enable direct parsing of nested java class classfileLukas Rytz2012-07-122-0/+17
| | | | by weakening an assertion. explained in the source comment.
* Merge pull request #874 from adriaanm/ticket-6022Adriaan Moors2012-07-112-0/+8
|\ | | | | SI-6022 model type-test-implication better
| * SI-6022 model type-test-implication betterAdriaan Moors2012-07-112-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | we use subtyping as a model for implication between instanceof tests i.e., when S <:< T we assume x.isInstanceOf[S] implies x.isInstanceOf[T] unfortunately this is not true in general. SI-6022 expects instanceOfTpImplies(ProductClass.tpe, AnyRefClass.tpe), but ProductClass.tpe <:< AnyRefClass.tpe does not hold because Product extends Any however, if x.isInstanceOf[Product] holds, so does x.isInstanceOf[AnyRef], and that's all we care about when modeling type tests
* | Pickled flag reorgMartin Odersky2012-07-112-0/+12
| | | | | | | | | | | | | | | | Cleaned up and optimized code that maps between raw and pickled flags. Avoids mystery constants. Makes a whole bunch of new flags be pickled which were not pickled before (more precisely: Everything in InitialFlags with value greater than 1 << 31 which is not in FlagsNotPickled now gets pickled whereas before it wasn't. Among these: VARARGS, IMPLCLASS, SPECIALZED, DEFAULTINIT, SYNCHRONIZED. I am curious how many tickets will get fixed by this change. The first one I noted is t5504, which previously enforced the buggy behavior through a neg check! There are also some build manager check file changes that have to do with the fact that flags now print in a different order for performance reasons.
* | Merge pull request #834 from paulp/issue/3836-2Adriaan Moors2012-07-061-0/+14
|\ \ | |/ |/| Fix SI-3836 not-really-ambiguous import detection.
| * Fix SI-3836 not-really-ambiguous import detection.Paul Phillips2012-07-051-0/+14
| | | | | | | | | | Normalize types before declaring that two imports are ambiguous, because they might be the same thing. Review by @moors.
* | Merge pull request #824 from adriaanm/ticket-4691_6008Adriaan Moors2012-07-062-0/+13
|\ \ | |/ |/| [SI-4691, SI-6008] improve patmat analyses: irrefutable user-defined extractors, no-op type tests
| * SI-6008 use static knowledge of success of type testsAdriaan Moors2012-07-052-0/+13
| | | | | | | | | | | | | | | | augment the equality axioms to take into account that a type test against the static type of a variable succeeds unless the variable is null for exhaustivity we disregard null, so the type test always succeeds during unreachability we model this knowledge as the obvious implication
* | SI-6033 Closed. Provides implicit conversion from java.math.BigInteger to BigIntDominik Gruntz2012-07-051-0/+5
|/
* Merge pull request #801 from paulp/issue/exponential-specAdriaan Moors2012-07-031-0/+47
|\ | | | | Fix for exponential compile time in specialization.
| * Fix for exponential compile time in specialization.Paul Phillips2012-06-301-0/+47
| | | | | | | | Review by @prokopec.
* | Merge pull request #771 from retronym/ticket/4176-2Adriaan Moors2012-07-022-0/+11
|\ \ | | | | | | SI-4176 A repeat dose of repeated parameter type sanitization.
| * | SI-4176 A repeat dose of repeated parameter type sanitization.Jason Zaugg2012-06-302-0/+11
| | | | | | | | | | | | | | | | | | | | | - During eta expansion, treat parameters of type A* as Seq[A] - Do the same for method/class parameters as referred to by an Ident. Also fixes SI-5967, which shows up during pattern matching.
* | | SI-5932 Tone down non-sensible == warning with refinements.Jason Zaugg2012-07-012-0/+16
| |/ |/| | | | | Errs on the side of avoiding false positives.
* | Merge pull request #793 from jsuereth/fix/convert-toJosh Suereth2012-06-291-1/+1
|\ \ | | | | | | Renaming convertTo to to on GenTraversableOnce.
| * | Renaming convertTo to to on GenTraversableOnce.Josh Suereth2012-06-281-1/+1
| | |
* | | Merge branch 'master' into issue/5846,4597,4027,4112Aleksandar Prokopec2012-06-2810-1/+84
|\| | | | | | | | | | | | | | | | | Conflicts: src/library/scala/collection/MapLike.scala src/library/scala/collection/SortedMapLike.scala
| * | Merge pull request #780 from hubertp/topic/fix-rangepos-buildAdriaan Moors2012-06-272-0/+10
| |\ \ | | | | | | | | Fix range positions when applying anonymous classes.
| | * | Fix range positions when applying anonymous classes. Review by @dragos or ↵Hubert Plociniczak2012-06-262-0/+10
| | | | | | | | | | | | | | | | @odersky
| * | | SI-5899 exhaustiveness for non-class typesAdriaan Moors2012-06-262-0/+20
| |/ /
| * / SI-5968 Eliminate spurious exhaustiveness warning with singleton types.Jason Zaugg2012-06-232-0/+9
| |/ | | | | | | A singleton type is a type ripe for enumeration.
| * Merge pull request #755 from axel22/issue/5284-cherry-pickedAdriaan Moors2012-06-221-1/+1
| |\ | | | | | | Fix SI-5284.
| | * Fix SI-5284.Aleksandar Prokopec2012-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was the false assumption that methods specialized on their type parameter, such as this one: class Foo[@spec(Int) T](val x: T) { def bar[@spec(Int) S >: T](f: S => S) = f(x) } have their normalized versions (`bar$mIc$sp`) never called from the base specialization class `Foo`. This meant that the implementation of `bar$mIc$sp` in `Foo` simply threw an exception. This assumption is not true, however. See this: object Baz { def apply[T]() = new Foo[T] } Calling `Baz.apply[Int]()` will create an instance of the base specialization class `Foo` at `Int`. Calling `bar` on this instance will be rewritten by specialization to calling `bar$mIc$sp`, hence the error. So, we have to emit a valid implementation for `bar`, obviously. Problem is, such an implementation would have conflicting type bounds in the base specialization class `Foo`, since we don't know if `T` is a subtype of `S = Int`. In other words, we cannot emit: def bar$mIc$sp(f: Int => Int) = f(x) // x: T without typechecking errors. However, notice that the bounds are valid if and only if `T = Int`. In the same time, invocations of `bar$mIc$sp` will only be emitted in callsites where the type bounds hold. This means we can cast the expressions in method applications to the required specialized type bound. The following changes have been made: 1) The decision of whether or not to create a normalized version of the specialized method is not done on the `conflicting` relation anymore. Instead, it's done based on the `satisfiable` relation, which is true if there is possibly an instantiation of the type parameters where the bounds hold. 2) The `satisfiable` method has a new variant called `satisfiableConstraints`, which does unification to figure out how the type parameters should be instantiated in order to satisfy the bounds. 3) The `Duplicators` are changed to transform a tree using the `castType` method which just returns the tree by default. In specialization, the `castType` in `Duplicators` is overridden, and uses a map from type parameters to types. This map is obtained by `satisfiableConstraints` from 2). If the type of the expression is not equal to the expected type, and this map contains a mapping to the expected type, then the tree is cast, as discussed above. Additional tests added. Review by @dragos Review by @VladUreche Conflicts: src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
| * | Merge pull request #735 from retronym/ticket/4842-2Adriaan Moors2012-06-211-0/+26
| |\ \ | | |/ | |/| SI-4842 Forbid access to in-construction this in self-constructor args
| | * SI-4842 Forbid access to in-construction this in self-constructor argsJason Zaugg2012-06-171-0/+26
| | | | | | | | | | | | | | | | | | | | | The check was already in place for direct calls to the super constructor. Without this additional check, ExplicitOuter crashes, as it doesn't create an $outer pointer for the constructor-arg scoped inner object, but expects one to exist when transforming the Outer.this reference.
| * | Fix for SI-5953, extension methods crasher.Paul Phillips2012-06-191-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As usual, .tpe -> .tpeHK. As a side note following an old theme, if symbols of type parameters knew that they were symbols of type parameters, they could call tpeHK themselves rather than every call site having to do it. It's the operation which injects dummies which should require explicit programmer action, not the operation which faithfully reproduces the unapplied type. Were it that way, errors could be caught much more quickly via ill-kindedness. Seems like an improvement over lurking compiler crashes at every call to tparam.tpe.
| * | Fix for java parser edge case.Paul Phillips2012-06-141-0/+2
| |/ | | | | | | Empty statements are A-OK. Closes SI-5910. Review by @dragos.
* / Fix SI-5846 and SI-4027.Aleksandar Prokopec2012-06-281-0/+10
|/
* Suppress non-local return unchecked warnings.Paul Phillips2012-06-122-0/+7
| | | | | There doesn't seem to be any way to do that by adding a synthetic annotation.
* Merge pull request #694 from retronym/ticket/4831-2Adriaan Moors2012-06-091-0/+11
|\ | | | | SI-4831 Fix ambiguous import detection for renamed imports.
| * SI-4831 Fix ambiguous import detection for renamed imports.Jason Zaugg2012-06-091-0/+11
| |
* | test case, closes SI-5738Eugene Burmako2012-06-091-0/+8
| |
* | test case, closes SI-5742Eugene Burmako2012-06-091-0/+8
|/
* Merge pull request #679 from axel22/issue/5853Adriaan Moors2012-06-081-0/+55
|\ | | | | Fix SI-5853.
| * Fix SI-5853.Aleksandar Prokopec2012-06-071-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This solves two issues. First, up to now the newly generated symbols for normalized members were not being added to the declaration list of the owner during `specialize`. Now they are. Second, during `extmethods`, the extension methods generated get an additional curried parameter list for `$this`. Trouble was, after that, during `uncurry` and before `specialize`, these curried parameter lists were merged into one list. Specialization afterwards treats extension methods just like normal methods and generates new symbols without the curried parameter list. The `extensionMethod` now takes this into account by checking if the first parameter of a potential extension method has the name `$this`. Review by @dragos. Review by @odersky.