aboutsummaryrefslogtreecommitdiff
path: root/tests/neg
Commit message (Collapse)AuthorAgeFilesLines
* Add spaces around + in tests.Dmitry Petrashko2015-04-092-3/+3
|
* Remove trailing spaces in Dotty tests.Dmitry Petrashko2015-04-094-13/+13
|
* Replace tabs with 4 spaces in Dotty tests.Dmitry Petrashko2015-04-091-9/+9
|
* Make all dotty tests end in newlineDmitry Petrashko2015-04-094-4/+4
|
* Disallow refinements of types or methods that do not appear in parent.Martin Odersky2015-03-185-25/+70
| | | | | | | | We planned this for a long time but never implemented it. Instead, we sometimes issued an erro in Splitter, namely if reflection would have been needed to access the member. It turns out that some tests (e.g. neg/t625) fail -Ycheck (we knew that before and disabled) but also fail Pickling because they generate orhpan PolyParams. So rather than patching this up it seems now is a good time to enforce the restriction for real.
* Prevent block types with references to local symbolsGuillaume Martres2015-02-111-0/+10
|
* More negative override testsMartin Odersky2015-02-071-0/+14
|
* New spec and implementation for matching.Martin Odersky2015-02-071-0/+8
| | | | | Reformulated matchign spec and implemented accordingly. Previous fix for #329 would have missed third new error case in over.scala.
* Fix of #329.Martin Odersky2015-02-071-0/+7
| | | | Overriding pairs needs to match ExprTypes with field types. Closes #329.
* Test reorgMartin Odersky2015-02-071-0/+21
|
* New test: moduleSubtypingMartin Odersky2015-01-141-0/+23
| | | | Tests (non)equivalence of modules and their ThisTypes.
* Merge pull request #279 from dotty-staging/test/#91odersky2014-12-131-0/+16
|\ | | | | Two new tests
| * Two new testsMartin Odersky2014-12-131-0/+16
| | | | | | | | | | 1) Verify we survive illegal infinite paths. Closes #91. 2) Verify we handle fbounds in and types correctly.
* | Disable implicit conversions between from `Null` and `Nothing`.Martin Odersky2014-12-131-0/+6
|/ | | | | | | | | | | | This is necessary to reject code like val x: Boolean = null Without the restriction, this code would typecheck and expand to val x: Boolean = Predef.Boolean2boolean(null) since `null` counts as a value of type `java.kang.Boolean`.
* Fixed testMartin Odersky2014-12-131-1/+1
|
* One more test case, coming from #214.Martin Odersky2014-12-131-0/+1
|
* Fix #248: Class cannot inherit from refinement typesMartin Odersky2014-12-131-0/+9
| | | | | | We now check that classes do not inherit from refinement types (unless they are an encoding of parameterized types), nor from & or | types.
* Allow refinements that refine already refined types.Martin Odersky2014-11-261-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, a double definition errorfor `T` was produced in a case like this: type T1 = C { T <: A } type T2 = T1 { T <: B } This was caused by the way T1 was treated in the refinement class that is used to typecheck the type. Desugaring of T2 with `refinedTypeToClass` would give trait <refinement> extends T1 { type T <: B } and `normalizeToClassRefs` would transform this to: trait <refinement> extends C { type T <: A; type T <: B } Hence the double definition. The new scheme desugars the rhs of `T2` to: trait <refinement> extends C { this: T1 => type T <: B } which avoids the problem. Also, added tests that #232 (fix/boundsPropagation) indeed considers all refinements together when comparing refined types.
* Fixed cycle detection.Martin Odersky2014-11-241-0/+13
| | | | Now detects the cycles reported by @retronym
* Added and corrected testsMartin Odersky2014-11-242-1/+5
| | | | to reflect last commit.
* Fixes in TypeComparer for RefinedTypes.Martin Odersky2014-11-243-46/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous scheme did not propagate bounds correctly. More generally, given a comparison T { X <: A } <: U { X <: B } it would errenously decompose this to T <: U, A <: B But we really need to check whether the total constraint for X in T { X <: A } subsumes the total constraint for X in T { X <: B } The new scheme propagates only if the binding in the lower type is an alias. E.g. T { X = A } <: Y { X <: B } decomposes to T { A = A } <: U, A <: B The change uncovered another bug, where in the slow path we too a member relative to a refined type; We need to "narrow" the type to a RefinedThis instead. (See use of "narrow" in TypeComparer). That change uncovered a third bug concerning the underlying type of a RefinedThis. The last bug was fixed in a previous commit (84f32cd814f2e07725b6ad1f6bff23d4ee38c397). Two tests (1048, 1843) which were pos tests for scalac but failed compling in dotc have changed their status and location. They typecheck now, but fail later. They have been moved to pending. There's a lot of diagnostic code in TypeComparer to figure out the various problems. I left it in to be able to come back to the commit in case there are more problems. The checks and diagnostics will be removed in a subsequent commit.
* Add tests for the overriding of typesGuillaume Martres2014-11-181-0/+11
| | | | These tests work correctly since 222e9a478f7b851582550973df6a9d141766e49a
* Merge pull request #228 from dotty-staging/fix/overridingodersky2014-11-182-0/+80
|\ | | | | Fix/overriding
| * Check that overriding members refine the types of overridden ones.Martin Odersky2014-11-181-0/+11
| | | | | | | | | | Somehow this was lost in porting (or was this done somewhere else in scalac?).
| * Fix OverridingPairsMartin Odersky2014-11-142-0/+69
| | | | | | | | | | | | | | | | OverridingPairs had several bugs which caused pairs to be lost, which caused missing overrides checks. Fixing OverridingPairs revealed several test failures (and a problem in Synthetics generation which was fixed in the last commit). Tests that became negative are all moved into neg/overrides.scala, and the original versions in pos were fixed.
* | Moved pending tests that work into pos and neg.Martin Odersky2014-11-171-0/+26
|/ | | | | | | One test (t2613) required lifting a hard recursion limit in findMember (used for debug only, will be removed in the future). The same test also requires -Yno-deep-subtypes to be reset, so it's in pos_special instead of pos.
* Detect cycles involving types bounded by singleton typesGuillaume Martres2014-11-061-0/+25
| | | | This fixes #193.
* Merge pull request #180 from smarter/fix/nosymbol-subtypingodersky2014-11-061-4/+5
|\ | | | | Fix subtyping of types without symbols
| * Fix subtyping of types without symbolsGuillaume Martres2014-10-091-1/+5
| |
| * Simplify subtying testGuillaume Martres2014-10-091-4/+1
| |
* | Avoid hoisting local classesMartin Odersky2014-10-261-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | The patch disables hoisting of classes local to a block into the result type of the block. Instead, we widen the result type of the block to one which reflects all refinements made to the parents type of the local class. Test cases in avoid.scala, t1569.scala. The original t1569.scala no longer works. Why is explained in neg/t1569-failedAvoid.scala
* | Fix handling of type params in secondary constructorsMartin Odersky2014-10-111-0/+47
| | | | | | | | | | | | | | | | | | Params are already added by Desugar. No special treatment needed here. Besides primaryConstructor.typeParams is always empty, because term symbols do not have type parameters. The fix turns t2660.scala into an error. I believe the error is correct, hence the test was moved with a comment to neg.
* | Merge pull request #174 from dotty-staging/rebDmitry Petrashko2014-10-117-0/+115
|\ \ | |/ |/| Pattern matcher
| * Fix problem in unapply typing.Martin Odersky2014-09-231-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | GADT bound resetting may only be applied when comparing <pattern type> <: <expected type>, not when comparing the other way around. The fix revealed an error in a test case (t1048) which looks like a real error. Therefore the test got moved to neg. Conflicts: src/dotty/tools/dotc/typer/Applications.scala test/dotc/tests.scala tests/disabled/t1048.scala
| * Disabling patmat tests failing due to typer.Dmitry Petrashko2014-09-231-0/+29
| |
| * Fixes to erasure to make -Ycheck:all work.Martin Odersky2014-08-281-0/+7
| | | | | | | | | | | | | | | | Main change: Introduce JavaArrayType as a new type constructor for Java erased array. Translate all methods of Array class during erasure to primitive operations on arrays. Some other small fixes for more localized problems.
| * Special context for self constructor argsMartin Odersky2014-08-242-0/+15
| | | | | | | | | | Arguments to this(...) calls need a special contet, similar to - but different from - the supercall context.
| * Re-enabled checkbounds testsMartin Odersky2014-08-081-0/+39
| | | | | | | | | | | | | | | | Now that F-bunded types are treated more robustly, we can check bounds for non-emptyness during Typer. This unvealed one wrong test (wonder how that passed scalac?), which got moved to neg.
| * Detect cycles and protected legal ones with LazyRefsMartin Odersky2014-08-081-0/+4
| | | | | | | | | | | | | | | | | | | | Cycles are now detected early, when an info is first completed. Legal, f-bounded cycles are broken by a LazyRef, which will construct its type lazily. This makes checkBounds validation of AppliedTypeTrees work (in FirstTransform). Formerly, this stackoverflowed despite the laziness precautions in findMember. Todo: Do the same for class files coming from Java and Scala 2.x.
* | Fix isSubType(A#X, B#X) not checking if A <: BGuillaume Martres2014-10-051-0/+13
|/
* Enabled variance checkingMartin Odersky2014-08-032-0/+69
| | | | | | | Variance checking is now run as part of type-checking. Fixed tests that exhibited variance errors. Added tests where some classes of variance errors should be detected.
* fix/148Martin Odersky2014-07-201-0/+44
| | | | Fixed typo in Splitter. Closes #148.
* Handling higher-kinded types with lambdasMartin Odersky2014-06-182-2/+3
| | | | | Switch to the new scheme where higher-kinded types (and also some polymorphic type aliases) are represented as instances of Lambda traits.
* Change definition of isLegalPrefix so that it allows projecting on an ↵Martin Odersky2014-06-121-0/+7
| | | | | | | | | | | | | | abstract type. This is needed to make the encoding og higher-kinded types work. E.g. Rep[Int] would be represented as Rep { type Arg$0 = Int } # Apply where Apply is an abstract member of the base class Lambfa$I of Rep.
* Reclassifying testsMartin Odersky2014-05-301-0/+35
|
* Avoid hoisting of local classes out of method bodies.Martin Odersky2014-05-201-2/+3
| | | | | | | | | | Doing so is unsound. We instead approximate local classes by their parents, but only if the expected type is not fully defined. This makes the test t2421_delitedsl1.scala in the commit pass. The oter test, blockEscapesNeg.scala is modified to fail. Previously it failed outright but with the new rules the nested class Bar is approximated to Object. That means that the block containing `Foo.Bar` typechecks, but with type `Object` instead of the unreachable `Bar`.
* Pos tests t17xx - t19xxMartin Odersky2014-05-201-0/+25
|
* Fixing tailrec test.Martin Odersky2014-05-081-1/+1
| | | | | null is not a subtype of a singleton type in Dotty. This slipped by the type checker before. With the tightened rules in the next commits, it will become illegal.
* TailRec phase and tests for it.Dmitry Petrashko2014-04-1112-0/+233
| | | | | | | | | | | | | | | | | | | | | | | | Ported tailcall phase from scalac with such changes: - all transformation is done in the phase itself (previously half of the work was done in backend) - it is now able to run before uncurry - it is now a treeTransform - renamed to tailrec to make it more obvious that this phase transforms only recursive calls. For now this is a single phase which speculatively transforms DefDefs. Speculation can be potentially removed by splitting into 2 phases: one detecting which methods should be transformed second performing transformation. But, as transformation requires as same amount of work as detection, I believe it will be simpler to maintain it as a single phase. Conflicts: tests/pos/typers.scala
* Flag self names that conflict with parameters or membersMartin Odersky2014-04-081-23/+39
| | | | | | | | | A self name may no longer have the same name as a parameterless class member (or param accessor). The restriction makes sense because otherwise scoping is confusing. It's needed because otherwise we get TermRefs that have the same name and prefix but denote different things. Moved some code which exercises this from pos/typers to neg/typers