aboutsummaryrefslogtreecommitdiff
path: root/tests/neg
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1456 from dotty-staging/fix-#1444odersky2016-08-213-2/+35
|\ | | | | Fix #1444: Pass implicits to parameterless traits if needed
| * Fix testMartin Odersky2016-08-201-1/+1
| |
| * Fix #1444: Add implicit arguments to supertraitsMartin Odersky2016-08-203-2/+35
| | | | | | | | | | | | | | | | If a super trait is given as a type (i.e. no argument list), implicit args were not passed. This is fixed now. Also, we now check for parameterized traits lacking type arguments in Typer instead of in Mixin. Fixes #1444.
* | Add import back.Martin Odersky2016-08-181-0/+2
| | | | | | | | Needed because the test is also run in neg wihtout command line option.
* | Refinements to auto tuplingMartin Odersky2016-08-181-2/+0
|/ | | | | | | | | | There's a nasty interaction with auto-tupling and trying to insert an implicit on the qualifier of a call. If the original call fails, we need to "undo" any auto-tupling decisions in calls where an implicit is inserted on the qualifier. Also: Needed to fix canAutoTuple test so that Scala2 feature is checked instead of dotty's. Also: Drop features in dotty.language that duplicate those in scala.language.
* Harden copmpareHkApply for ill-typed programsMartin Odersky2016-08-171-0/+25
| | | | Turn assertion into test. Without this, neg/tcpoly_overloaded.scala fails.
* New string infterpolatorsMartin Odersky2016-08-161-0/+26
| | | | | | Roll `sm` and `i` into one interpolator (also called `i`) Evolve `d` to `em` interpolator (for error messages) New interpolator `ex` with more explanations, replaces disambiguation.
* Error message for illegal self type (#1424)Martin Odersky2016-08-161-0/+3
| | | | Remove debug info from error message.
* Suspend interpolating typevars when there are unreported errors.Martin Odersky2016-08-161-0/+8
| | | | | | | | Interpolating typevars that appear co- or contra-variantly in a type is a cleanup measure - it helps keep the constraint set small. However, if there are uneported errors, some of these errors might report on unsatisfiable constraints for these type variables. In that case, instantiating the type variables risks being confusing.
* Fix #1443: Replace toplevel TypeBounds with AnyClemens Winter2016-08-151-0/+20
|
* Merge pull request #1399 from dotty-staging/fix-patmat-typingodersky2016-07-182-0/+25
|\ | | | | Fix typing of match expressions
| * Fix test error annotationMartin Odersky2016-07-181-1/+1
| |
| * Add test caseMartin Odersky2016-07-181-0/+24
| | | | | | | | Also fix reviewers comments about `firstParent`
| * Fix typing of match expressionsMartin Odersky2016-07-171-0/+1
| | | | | | | | | | Allow matches between unapply types and selector type where a possible overlap might exist.
* | Merge pull request #1389 from dotty-staging/fix-#1381odersky2016-07-181-47/+0
|\ \ | |/ |/| Changes to overloading
| * Changes to overloadingMartin Odersky2016-07-151-47/+0
| | | | | | | | | | | | Fix #1381: Overloading is now changed so that we first try without implicit searches. Only if that leaves no applicable alternatives we try again with implicit search turned on. This also fixes test case t2660, which got moved from neg to pos.
* | Merge pull request #1291 from nicolasstucki/implement-scala-dynamicDmitry Petrashko2016-07-1532-0/+291
|\ \ | | | | | | Add scala.Dynamic support.
| * | Fix TypeOps.featureEnabled ignoring import disabling.Nicolas Stucki2016-07-071-0/+10
| | |
| * | Add scala.Dynamic language feature check.Nicolas Stucki2016-07-071-0/+3
| | |
| * | Fix #657: Add scala.Dynamic support.Nicolas Stucki2016-07-0731-0/+278
| | |
* | | Merge pull request #1334 from dotty-jvican/implement-no-predef-no-importDmitry Petrashko2016-07-153-0/+9
|\ \ \ | |_|/ |/| | Implement -Yno-predef and -Yno-imports
| * | Implement -Yno-predef and -Yno-importsjvican2016-06-293-0/+9
| | | | | | | | | | | | | | | | | | * Implement flags -Yno-predef and -Yno-imports * Add unit tests for both
* | | Bounds of type lambdas compare contravariantlyMartin Odersky2016-07-152-1/+9
| | | | | | | | | | | | | | | | | | | | | Enable checking of bounds when comparing type lambdas. This invalidates a pattern used in t2994 and potentially other code, where a bound [X] -> Any is used as a template that is a legal supertype of all other bounds. The old behavior is still available under language:Scala2.
* | | Add test case for hk bounds checkingMartin Odersky2016-07-141-0/+23
| | |
* | | Fix bounds checking of hk applied typedMartin Odersky2016-07-141-4/+4
| | | | | | | | | | | | | | | Previous logic could only handle classes as constructors. Also, address other reviewers comments.
* | | Allow hk parameters in lower boundsMartin Odersky2016-07-132-11/+4
| | |
* | | Drop restriction to 2nd order hk typesMartin Odersky2016-07-121-3/+3
| | | | | | | | | | | | Allow hk type parameters to be higher kinded themselves.
* | | Avoid dealiasing on type applicationMartin Odersky2016-07-122-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | When applying a type alias of a type lambda, keep the original application instead of reducing. But reduce anyway if - the reduced type is an application where the type constructor has the same kind as the original type constructor, or - some of the arguments are wildcards.
* | | Allow definition of new types in refinementsMartin Odersky2016-07-124-10/+10
| | | | | | | | | | | | | | | Allow definition of types in refinements that do not appear in parent type.
* | | Fix SI-2712Martin Odersky2016-07-111-0/+11
| | | | | | | | | | | | | | | Allows partially instantiated types as type constrictors when inferring higher-kinded types.
* | | More testsMartin Odersky2016-07-111-0/+11
| | |
* | | Disallow higher-kinded types that simulate general existential typesMartin Odersky2016-07-111-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We cannot handle such types in general. So we now check that a hk application C[args] where some of the arguments are wildcards does not have as a supertype a hk application ([X] -> B)[args]
* | | Don't make * types higher-kinded in avoidMartin Odersky2016-07-112-10/+10
| | | | | | | | | | | | Also, fix error counts in tests for new hk scheme.
* | | Change testsMartin Odersky2016-07-111-37/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - compileMixed failed because there was a cycle between immutable.Seq (compiled) and parallel.ParSeq (loaded from classfile). Inspection of the completion log (turn completions Printer on) and the stack trace showed that there's nothing we can do here. The old hk scheme did not go into the cycle because it did not force an unrelated type. I believe with enough tweaking we would also hva egotten a cycle in the old hk scheme. The test is "fixed" by adding parallel.ParSeq to the files to compile. - Disable named parameter tests Those tests do not work yet with the revised hk scheme. Before trying to fix this, we should first decide what parts of named parameters should be kept.
* | | Eta-expand unapplied types that have type parametersMartin Odersky2016-07-111-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We would like to change from a scheme where eta-expansion was prototype driven to one where unapplied parameterized types are always eta expanded. The reason is that we might miss some eta expansions due to cyclic references. run/colltest4 is an exmaple. Here, we missed an eta expansion in the type of Iterator. The class definition is: trait Iterable[+A] extends IterableOnce[A] with FromIterable[Iterable] { We'd expect that the second parent would expand to FromIterable[[X0] -> Iterable[X0]] But we miss the expansion because at the time we complete Iterable we have not completed FromIterable yet. In fact this happens in both the old and the new hk scheme. But in the old scheme we did not notice the error whereas in the new scheme we get an error in PostTyper that the type Iterable does not conform to its bound `[X0] -> Iterable[X0]`. With this commit, we change the scheme, so that eta-expansion depends on the type parameters of a type itself, instead of the expected type. We should investigate whether we can do a similar change for Scala2 classloading. Check kinds of type parameters Also, do not allow a hk type if the bound is a * type.
* | | Add a second betaReduceMartin Odersky2016-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new one only reduces straight applications of type lambdas with definite arguments. It is called very early on appliedTo, and derivedRefinedType. The old one, now renamed to normalizeHkApply also handles wildcard arguments and can garbage collect general unneeded hk-refinements. It is called later, at various places. TODO: See what functionality of normalizeHkApply should go into betaReduce instead. Maybe we can even drop normalizeHkApply? However: need to be careful to maintain aliases for hk type inference.
* | | Normalize RecTypes on creation to avoid cycles.Martin Odersky2016-07-111-20/+21
| |/ |/| | | | | | | With this change, ski compiles (but with more errors than before). Without it, it goes into various infinite recursions.
* | Fix #856: Handle try/catch cases as catch cases if possible.Nicolas Stucki2016-06-281-0/+35
| | | | | | | | | | | | | | Previously they were all lifted into a match with the came cases. Now the first cases are handled directly by by the catch. If one of the cases can not be handled the old scheme is applied to to it and all subsequent cases.
* | Test #1224.Dmitry Petrashko2016-06-071-0/+11
| |
* | Test #1220Dmitry Petrashko2016-06-071-0/+4
|/
* Properly report errors when cli flags are malformedGuillaume Martres2016-06-021-0/+2
| | | | | Previously we returned an empty Reporter with no errors so partest reported the test as a success.
* Don't evaluate isInstanceOf for value classes, disable bugged testsFelix Mulder2016-05-261-0/+6
| | | | | | | The tests `i1059.scala` and `t3480.scala` are failing due to a bug in pattern matcher that evaluates the `x` in `List(x: _*)` incorrectly. Concerned issue: #1276
* Add Eq instances of standard types to PredefMartin Odersky2016-05-231-1/+10
| | | | | | | | | To make tests pass, this required a looser specification of `assumedCanEquals`, so that an abstract type T can be compared to arbitrary values, as long as its upper bound can be compared. E.g. T == null T == "abc"
* Add Java types to equality testMartin Odersky2016-05-231-0/+21
|
* Make Eq contravariantMartin Odersky2016-05-231-5/+4
| | | | (and add it to commit set).
* Test caseMartin Odersky2016-05-231-0/+80
|
* Hooks to check that comparisons with == / != make senseMartin Odersky2016-05-231-96/+0
| | | | | | | | | | Also, check that pattern matching against idents/selects/literals makes sense. The hooks perform an implicit search for an instance of `Eq[L, R]`, where `L`, `R` are the argument types. So far this always succeeeds because Eq.eqAny matches all such types. A separate commit will check the returned search term for validity.
* Add new strawman for multiversal equalityMartin Odersky2016-05-231-0/+96
|
* Remove stray testMartin Odersky2016-05-191-17/+0
| | | | Real test is in neg/customargs
* Handle MergeErrors in RefChecksMartin Odersky2016-05-192-14/+26
| | | | | Used to throw an uncaught merge error in checkAllOverrides when compiling i1240c.scala.