aboutsummaryrefslogtreecommitdiff
path: root/test/dotc/tests.scala
Commit message (Collapse)AuthorAgeFilesLines
* Add test for backend.Dmitry Petrashko2014-12-161-1/+3
|
* Disable backend by default in tests.Dmitry Petrashko2014-12-161-1/+5
|
* Erasure is on by default.Dmitry Petrashko2014-12-161-30/+30
| | | | Remove historical enabling of erasure for some tests: its enabled by default now
* Merge pull request #279 from dotty-staging/test/#91odersky2014-12-131-0/+1
|\ | | | | Two new tests
| * Two new testsMartin Odersky2014-12-131-0/+1
| | | | | | | | | | 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/+1
|/ | | | | | | | | | | | 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`.
* One more test case, coming from #214.Martin Odersky2014-12-131-1/+1
|
* Fix #248: Class cannot inherit from refinement typesMartin Odersky2014-12-131-0/+1
| | | | | | We now check that classes do not inherit from refinement types (unless they are an encoding of parameterized types), nor from & or | types.
* Merge pull request #242 from dotty-staging/fix/mixinsDmitry Petrashko2014-11-261-2/+1
|\ | | | | Fix/mixins
| * Allow deep subtypes in dotc_transform.Martin Odersky2014-11-261-1/+1
| | | | | | | | The clause got accidentally dropped in the rebase.
| * Fixed data race in ResolveSuperMartin Odersky2014-11-261-2/+1
| | | | | | | | | | | | | | | | | | | | The datarace happened because for method "transform" implemented by ResolveSuper which disambiguated overridden methods. Previously, there was a reference FirstTransform.this.transform of type termRefWithSig to the method implemented in a super trait. Now the same reference points to the newly implemented method. Solved because ResolveSuper now generates symbolic references.
* | Allow refinements that refine already refined types.Martin Odersky2014-11-261-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | Now detects the cycles reported by @retronym
* Added and corrected testsMartin Odersky2014-11-241-2/+2
| | | | to reflect last commit.
* Fixes in TypeComparer for RefinedTypes.Martin Odersky2014-11-241-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Make reduceProjection use lookupRefinedMartin Odersky2014-11-241-1/+1
| | | | | | | | | | | Needed some fixes to lookup refined. The potential alias type is now calculated by taking the member of the original refined type, instead of by simply following the refined info. This takes into account refinements that were defined after the refinement type that contains the alias. The change amde another test (transform) hit the deep subtype limit, which is now disabled.
* Enabling java testsDmitry Petrashko2014-11-221-5/+5
|
* create dummy first constructor for Java classesOndrej Lhotak2014-11-221-1/+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-221-0/+7
|
* Add tests for the overriding of typesGuillaume Martres2014-11-181-1/+1
| | | | These tests work correctly since 222e9a478f7b851582550973df6a9d141766e49a
* Enable pos/overrides.scala in testsGuillaume Martres2014-11-181-0/+1
|
* Merge pull request #228 from dotty-staging/fix/overridingodersky2014-11-181-0/+2
|\ | | | | Fix/overriding
| * Check that overriding members refine the types of overridden ones.Martin Odersky2014-11-181-1/+1
| | | | | | | | | | Somehow this was lost in porting (or was this done somewhere else in scalac?).
| * Fix OverridingPairsMartin Odersky2014-11-141-0/+2
| | | | | | | | | | | | | | | | 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/+2
|/ | | | | | | 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.
* Fix subtyping checks involving ThisType and PolyParamGuillaume Martres2014-11-111-0/+1
|
* Merge pull request #217 from dotty-staging/transform/mixinDmitry Petrashko2014-11-101-1/+1
|\ | | | | Transform/mixin
| * Merge memoize with miniphases following it into one group.Martin Odersky2014-11-091-1/+1
| |
| * Reinstantiated full tests.Martin Odersky2014-11-091-2/+2
| | | | | | | | | | The fix to Types in 9bb35512 (Retract of optimization in computeDenot) allowed the two tests to compile "twice" again.
| * New Mixin scheme.Martin Odersky2014-11-091-2/+2
| | | | | | | | | | | | | | Split into two phases, ResolveSuper before Erasure and Mixin after. Likewise GettersSetters is split into Getters and Memoize. All tests pass, except two tests fail when compiled twice. Will investigate next why.
| * Improved version of mixin.Martin Odersky2014-11-091-1/+1
| | | | | | | | | | 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-091-1/+1
|\| | | | | Transform/private to static
| * New phase: RestoreScopesMartin Odersky2014-11-091-1/+1
| | | | | | | | | | | | | | | | Cleans up after LambdaLift and Flatten. RestoreScopes exhibited a problem (double definition) when compiling Unpickler. The root of the problem was in Applications.scala. The effect was that arguments woulkd be lifted out, but then the argument expression would be used anyway. That caused a closure to be present twice which caused the double def error much later. -Ycheck did not catch it because the two closure expressions were in non-overlapping scopes.
| * New miniphase: FlattenMartin Odersky2014-11-091-1/+1
| |
* | Detect cycles involving types bounded by singleton typesGuillaume Martres2014-11-061-0/+2
|/ | | | This fixes #193.
* Merge pull request #180 from smarter/fix/nosymbol-subtypingodersky2014-11-061-1/+1
|\ | | | | Fix subtyping of types without symbols
| * Fix subtyping of types without symbolsGuillaume Martres2014-10-091-1/+1
| |
* | Fix treatment of by name functionsMartin Odersky2014-10-271-4/+1
| | | | | | | | | | | | | | By-name functions like `(=> T) => T` were not treated correctly before. Witness the disabled `-Ycheck:gettersSetters` for transform/TreeCheckers in thge test suite. This commit changes the scheme how => T types are treated and fixes the problems with by-name functions.
* | Better tests and bugfix for named argsMartin Odersky2014-10-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original problem was that in an expression f(x = bar(y = z)) only the outer named arg was eliminated by FirstTransform. The first error was that the postcondition in FirstTransform did not get to the named arg, because it got called from the overrdden typed method in TreeChecker, yet function arguments were evaluated with typedUnadapted. action: change Retyper and TreeChecker to override typedUndapped instead of typed. This flushed out the second error: transformOther in FirstTransform needs to recursively transform the argument of a NamedArg, because the framework itself does not handle NamedArg nodes. Now, all tests pass except that TreeChecker itself fails -Ycheck:gettersSetters due to a problem with handling by-name function types. This should be fixed in a separate PR.
* | Almost all tests pass -Ycheck:lambdLiftMartin Odersky2014-10-261-2/+5
| | | | | | | | | | | | | | | | | | | | Only exception: dotc/transform. This seems to be for two reasons: 1) The call-by-name functions used in Decorator#foldRightBN cannot be translated correctly at their use points. 2) An anonymous function in Constructors are not correctly lifted. 2) could be related to missing/duplicated symbols in pattern matcher. I'll follow up with a commit that points these out.
* | Avoid hoisting local classesMartin Odersky2014-10-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | More refined printing optionsMartin Odersky2014-10-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using RefinedPrinter we now have a choice whether when printing a definition tree such as def foo(x: T): U we print the parameter and result type info found in the tree or in the symbol. Previously, we printed the sym info when after typer and the tree info before. This turns out to be too inflexble. With the patch, we print the sym info if option -Yprint-syms is set, and the tree info otherwise. Also, align -Yno-deep-subtypes from camelCase to standard hyphenated option notation. Tweak where unique ids are printed.
* | Adaptations to make pattern matcher in new worldMartin Odersky2014-10-121-8/+4
| | | | | | | | | | | | | | | | | | | | Tests now always include erasure (before quite a few tests failed when erasure was enableed). By contrast lazy vals creates problems with erasure, disabled for now. Some other small polishings on integration of pattern matcher with rest of dotc. Deep recompilation of tools still fails, currently disabled.
* | Fix typing of _* patterns.Martin Odersky2014-10-121-0/+1
| | | | | | | | And bring back two tests for typing of patterns
* | Add possibility to compile all files in a directory and all subdirectories.Martin Odersky2014-10-121-1/+1
| | | | | | | | | | We better make this configurable. Because sometimes we want to compile only the files in the immediate directory.
* | Add constructors phaseMartin Odersky2014-10-111-7/+1
| |
* | Merge pull request #174 from dotty-staging/rebDmitry Petrashko2014-10-111-8/+25
|\ \ | |/ |/| Pattern matcher
| * Cleanup tests.Dmitry Petrashko2014-10-111-11/+6
| |
| * Remove outdated tests.Dmitry Petrashko2014-10-111-2/+0
| | | | | | | | dotc_core_transform directory is empty. Files where moved while restructuring erasure.
| * Enable all testsDmitry Petrashko2014-10-111-0/+1
| |