aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #279 from dotty-staging/test/#91odersky2014-12-132-0/+17
|\ | | | | Two new tests
| * Two new testsMartin Odersky2014-12-132-0/+17
| | | | | | | | | | 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`.
* Merge pull request #277 from dotty-staging/change/drop-not-nullodersky2014-12-131-0/+19
|\ | | | | Change/drop not null
| * Fix subtyping of null and refined types.Martin Odersky2014-12-131-0/+19
| |
* | 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.
* Previous scheme was buggy; leaked Array types to backend.Martin Odersky2014-11-281-0/+14
| | | | | | Now: All new Array[T] methods are translated to calls of the form dotty.Arrays.newXYZArray ...
* Allow refinements that refine already refined types.Martin Odersky2014-11-262-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Added test case from SI-6169Martin Odersky2014-11-251-0/+69
|
* Simpler cycle detectionMartin Odersky2014-11-241-0/+5
| | | | | | | | | | | Turns out that the last commit was a red herring. None of the hoops it jumped though was necessary. Instead there was a bug in isRef which caused `&` to erroneously compute T & Int as Int. The bug was that we always approximated alias types by their high bound. But in the present case, this leads to errors because U gets 'bounds >: Nothing <: Any', but it was still an alias type (i.e. its Deferred flag is not set). The fix dereferences aliases only if their info is a TypeAlias.
* 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.
* Better printing of variant types with wildcard arguments.Martin Odersky2014-11-241-0/+11
| | | | | We used to approximate these by their bounds, but this is confusing. See comment in printbounds.scala.
* Fix to checkBoundsMartin Odersky2014-11-241-0/+8
| | | | | Need to account for the fact that some argument types may be TypeBoudns themselves. The change makes Jason's latest example work.
* Fixes in TypeComparer for RefinedTypes.Martin Odersky2014-11-244-22/+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.
* Fixed type adaptation problem in checkBoundsMartin Odersky2014-11-241-0/+18
| | | | | | | We need to adapt type parameter bounds with an as-ssen-from to the prefix of the type constructor. Makes pos/boundspropagation pass.
* Moving java tests to posDmitry Petrashko2014-11-2283-0/+5
|
* Java annotations parsing problemDmitry Petrashko2014-11-221-1/+5
| | | | | | | | | | Annotations in java could be compiled as-if array-only annotation had <repeated> arguments constructor. That isn't true for scala. Also, type checking creation of single-element array requires implicit resolution to provide ClassTag. This makes problems while reading deferred annotation.
* create dummy first constructor for Java classesOndrej Lhotak2014-11-222-0/+0
| | | | | | The dummy constructor is needed so that the real constructors see the import of the companion object. The constructor has a parameter of type Unit so that no Java code can call it.
* support running java-interop testsOndrej Lhotak2014-11-2210-1/+1
|
* Testcase that shows bug in ElimRepeated.Dmitry Petrashko2014-11-221-0/+3
|
* Add the right constructor to Java annotationsMartin Odersky2014-11-221-0/+11
|
* Add tests for the overriding of typesGuillaume Martres2014-11-182-0/+20
| | | | These tests work correctly since 222e9a478f7b851582550973df6a9d141766e49a
* Merge pull request #228 from dotty-staging/fix/overridingodersky2014-11-186-4/+92
|\ | | | | 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-146-4/+81
| | | | | | | | | | | | | | | | 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.
* | Merge pull request #230 from dotty-staging/fix/and-or-subtypingodersky2014-11-181-0/+13
|\ \ | | | | | | Try to avoid overconstraining when comparing and/or types
| * | Fixed typosMartin Odersky2014-11-181-3/+0
| | |
| * | Restored accidentally deleted test code.Martin Odersky2014-11-181-0/+6
| | |
| * | Try to avoid overconstraining when comparing and/or typesMartin Odersky2014-11-162-17/+15
| |/ | | | | | | | | See comments in eitherIsSubType for an explanation what the problem is. Some test cases are in subtyping.scala
* / Moved pending tests that work into pos and neg.Martin Odersky2014-11-179-34/+0
|/ | | | | | | 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.
* Fixes problem exhibited by ensuring.scalaMartin Odersky2014-11-131-0/+0
| | | | | Need to account for the possibility that function arguments are wrapped in braces.
* Fix subtyping checks involving ThisType and PolyParamGuillaume Martres2014-11-111-0/+6
|
* Merge pull request #217 from dotty-staging/transform/mixinDmitry Petrashko2014-11-102-3/+3
|\ | | | | Transform/mixin
| * Adding test for Unit vars.Martin Odersky2014-11-091-1/+1
| |
| * Improved version of mixin.Martin Odersky2014-11-091-2/+2
| | | | | | | | | | Now also handles all supercalls. Seems to do the right thing on pos/traits.scala. But does not pass most tests because the sym transformer forces too many things.
* | Merge pull request #207 from dotty-staging/transform/privateToStaticodersky2014-11-093-0/+97
|\| | | | | Transform/private to static
| * New phase: PrivateToStaticMartin Odersky2014-11-093-0/+97
| | | | | | | | | | Make private methods in traits static, so that we do not need to give a default for them.
* | 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
| |
* | Merge commits '474b2ae' and '46eb5ea' from #201 into umasterDmitry Petrashko2014-11-031-0/+15
|\ \
| * | Added a test for by name functionsMartin Odersky2014-10-281-0/+15
| | |
* | | Typer should leave inline exception handlers inline.Dmitry Petrashko2014-10-301-2/+8
| | |
* | | TailRec now handles Try with Ident-handlerDmitry Petrashko2014-10-301-0/+14
|/ /
* | LambdaLift checks now explicitly for references to labels outside scope.Martin Odersky2014-10-261-0/+0
| | | | | | | | | | Nested methods cannot refer to labels in theior environment. Needs a fix in TailCalls. Moved failing test to pending.
* | Avoid hoisting local classesMartin Odersky2014-10-264-5/+31
| | | | | | | | | | | | | | | | | | | | | | | | 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