aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
Commit message (Collapse)AuthorAgeFilesLines
* New testsMartin Odersky2014-10-127-0/+126
|
* Move private fields into constructorMartin Odersky2014-10-112-0/+86
| | | | | | | Private fields that are accessed only from the constructor, and are accessed only after they are properly initialized are now moved into the constructor. This avoids creating a redundant objetc field. Good example: gcd in Rationals (see constrs.scala).
* Fix handling of type params in secondary constructorsMartin Odersky2014-10-111-25/+0
| | | | | | | | | 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.
* Cleanup patmat based on feedbackDmitry Petrashko2014-10-111-0/+1
| | | | from pr #174.
* Enable outer tests in pattern matcher.Dmitry Petrashko2014-10-111-0/+12
| | | | And a test for this.
* Bring back test removed between merges.Dmitry Petrashko2014-10-111-0/+12
|
* Make changeOwner more robust regarding non-standard owner chainsMartin Odersky2014-10-111-12/+0
| | | | | | | | | | | The problem is running changeOwner(from, to) where - from is a ValDef or a Label - an embedded definition has as owner not `from` but some owner of `from`. We allow such denomrlaized owners and the pattern matcher generates them. This patch makes changeOwner take these situations into account.
* Fix #167Martin Odersky2014-10-111-0/+12
| | | | Can handle now vararg arguments in patterns.
* Renamed parameters in Typer&Applictaions.Dmitry Petrashko2014-09-231-29/+0
| | | | Indicating that pt is type of selector is this pattern match makes it easier to follow.
* All pat-mat specific tests succeed now.Dmitry Petrashko2014-09-171-14/+0
| | | | | Except t1048 which infers incorrect type in typer, patmat creates a tree that computes a more precise one that fails to typecheck Disabling erasure due to dozens of "Type BLA is illegal after erasure" errors.
* More complicated tests for patmatDmitry Petrashko2014-09-171-12/+30
|
* Several fixes to patmat.Dmitry Petrashko2014-09-171-12/+12
| | | | Now patmat passes tests but erasure fails.
* More complicated patterns.Dmitry Petrashko2014-09-171-0/+24
|
* New phase: CapturedVarsMartin Odersky2014-09-121-0/+25
| | | | Breaks out boxing functionality of captured vars from lambda lift.
* Handle return in tailcalls.Martin Odersky2014-09-121-0/+5
| | | | | Avoids characterizing the "from" link in a return as a tail call reference.
* Better tests and more fixes for ExplicitOuterMartin Odersky2014-09-061-0/+14
| | | | | | Now also testing that after erasure no outer this exists. Tests suit now includes calls to local classes and methods which need an outer pointer, as well as passing an outer pointer along a secondary constructor.
* Bring back blockescapes test...Martin Odersky2014-09-061-0/+11
| | | | ... by reverting a premature optimization in Erasure.
* Partially reverting of 08c6eacaMartin Odersky2014-09-051-11/+0
| | | | | | | | | | | | | | | Partial revert of 08c6eaca "this type is a term ref to the source module". The problem with doing this is that it introduces spurious outer references. An inner module that contains self referenves always needs the directly enclosing class. The revert avoids this dependency by making ThisTypes always point to TypeRefs. Several other changes were necessary to make the builds pass: TypeRefs had to get prefixes after erasure so that they can be reloaded. Symbols of such typerefs had to be retrieved without forcing a denotation. One test (blockescapes.scala) fails and is moved to pending, awaiting further resolution. Also two other new tests in pending which currently fail (and have failed before).
* Add outer parameters in constructor calls.Martin Odersky2014-08-311-6/+6
| | | | | 1) Constructors of inner classes get outer parameters 2) Outer arguments are passed as needed.
* New phase: outerAccessorsMartin Odersky2014-08-311-0/+48
| | | | | | | | The new phase replaces attachOuter. It creates outer accessors where needed but does not yet define outer parameters or pass outer arguments. It should run before pattern matcher, so that pattern matcher can access the outer fields of scrutinees.
* Fixes to erasure to make -Ycheck:all work.Martin Odersky2014-08-282-0/+15
| | | | | | | | 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.
* Check that idents don't assume magic.Martin Odersky2014-08-241-1/+5
| | | | | | In TreeChecker, make sure that every identifier has a type with an elidable prefix. This excludes identifiers pointing to members of random prefixes without making the prefix explicit in the tree as part of a Select node.
* Make ElimByName change owners of by-name parametersMartin Odersky2014-08-181-0/+21
| | | | | | | | | By-name parameters did not have their owner changed before. This was not noticed in treecheck because the method generated for the closure did not have its Method flag set by accident, so owmer checking ignored the new val. Once the Methgod flag was set, owner checking failed. Once changeOwner was added, a whole lot of other things failed, which led to the fixes in the previous commits.
* Split Nullarify functionality to ElimByName, ErasureMartin Odersky2014-08-171-3/+3
| | | | | | | | | | | | | New phase ElimByName elimintaes by-name parameters. All other occurrences of parameterless methods and ExprTypes are eliminated in erasure. The reason for the split like this is that it is very hard for Nullarify to determine when to insert ()'s. The logic for this is fragile because we need to look at previous denotations which might not exist (before splitter) or might result from a merge between parameterless and nullary methods. In Erasure the same is much simpler to achieve.
* Fix and enable RefChecksMartin Odersky2014-08-137-46/+49
| | | | RefChecks is now enabled. Some of the tests had to be fixed to be refchecks-correct.
* Re-enabled checkbounds testsMartin Odersky2014-08-081-39/+0
| | | | | | | | 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.
* Enabled variance checkingMartin Odersky2014-08-033-2/+5
| | | | | | | 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.
* Add test for tailcallDmitry Petrashko2014-07-221-0/+4
| | | | Test for order of type parameters in recursive call
* Merge pull request #149 from dotty-staging/fix/#148Nada Amin2014-07-201-0/+44
|\ | | | | fix/#148
| * fix/148Martin Odersky2014-07-201-0/+44
| | | | | | | | Fixed typo in Splitter. Closes #148.
* | Added test for #143 to regression testsMartin Odersky2014-07-191-0/+14
|/
* Handle selftypes in FullParameterizationMartin Odersky2014-07-171-0/+6
| | | | Adapt the transformation so that self types are handled correctly.
* Fix to rewire typesMartin Odersky2014-07-172-2/+19
| | | | | | | t6574 has a new test where we produce identical code in an if-then-else. This broke the rewiring logic before, and is fixed now. Also, more comments and test cases.
* Enabled ExtensionMethodsMartin Odersky2014-07-171-0/+109
| | | | | | | | | Fixed extension methods so that it now runs and passes the build. Also enables ElimRepeated, which is a prerequistite for ExtensionMethods. Exception: Tailrec is currently disabled, because it needs to run before ExtensionMethods but it fails the -Ycheck test. Therefore the current tests skip this phase.
* Removed test caseMartin Odersky2014-07-171-17/+0
| | | | | d.T is an access to a structural type member, so rejecting this is OK. Not sure why we compiled this before without warning.
* Added phase: SuperAccessorsMartin Odersky2014-07-171-0/+11
| | | | | Rewrote SuperAccessors (more to be done; see comments), and added stuff here and there to make it work smoother.
* Added test case for LMS inspired HK code.Martin Odersky2014-06-261-0/+43
| | | | Closes #94.
* Avoid caching values that depend on typevar state.Martin Odersky2014-06-201-0/+6
| | | | | | | | | | | | | | TypeVars flip from the initial state, where underlying == origin to the final state where underlying == inst. This flip can invalidate information that depends on the underlying type of a TypeVar. Since we do not know when the flip occurs, we need to avoid keeping any such information in a cache. The commit makes three caches depend on a new value: typerState.ephemeral. The value is set to `true` each time we follow the underlying type of a TypeVar, and this disables cached information to be retained. A test case for this commit is t2693.scala. This test passes typechecking with the previous commit, but fails in -Ycheck:front because of stale cache info in an "#Apply" typeref. The present commit fixes that.
* Fixes to lambda abstractionMartin Odersky2014-06-191-0/+15
| | | | | | 1) Honor variance of Apply and $hkArgs when instantiating them 2) Eta-lifting a higher-kinded type is straight eta expansion, no arguments are applied.
* Handling higher-kinded types with lambdasMartin Odersky2014-06-1810-12/+153
| | | | | 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/+14
| | | | | | | | | | | | | | 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.
* Avoid classtype checking for refinements.Martin Odersky2014-05-301-0/+22
| | | | | | In a refinement type T { R } we do not need T to be a class. But analyzing the refeinement type will create a temporary class type. This refinement class has to be treated specially in what concerns parent types.
* Simplify result handling in FunProto.Martin Odersky2014-05-301-0/+7
| | | | | | Following the example of SelectionProto, we now always hide the result in a FunProto behind an IgnoreProto. This avoids a special case retry with a weaker FunProto in tryInsertApplyOrImplicit.
* Always ignore type in selectionProtoMartin Odersky2014-05-301-0/+8
| | | | | | | | | | | | | The type of a SelectionProto needs to be ignorable because there might be an implicit conversion on the selection. E.g. implicit def a2b(x: A): B = ??? val x: { a: A } = ??? val b: B = x.a This was previously handled by allowing implicit conversions in compatibility checks. But it turns out we can afford to ignore the type of a selectProto and unignore on ambiguities later.
* Triage of tests t27xx-t29xx.Martin Odersky2014-05-3020-0/+151
|
* tests t26xxMartin Odersky2014-05-3014-0/+294
|
* Fix of t2591.Martin Odersky2014-05-301-0/+15
| | | | | | | Needed to wrap a dummyTreeOfType in a TypedSplice to prevent re-typechecking. (In fact, the "tree without pos" check revealed a deeper problem: DummyTrees of types could be typed again, but without the surrounding TypedSplice, the originally stored type would be forgotten and Null would be returned.
* Added t25xx testsMartin Odersky2014-05-303-0/+33
|
* Fix of t2504Martin Odersky2014-05-302-6/+6
| | | | | | | | | Another problem where we need to insert an implicit on the result type of complex operation. Two additions: (1) If adapt fails, we now try with a weaker FunProto without result type, thus allowing for an additional implicit cpmversion on the result. (2) An Application in a committable context will not fail if the result type does not match the expected one. The problem will be simply deferred in that case.
* Fix of pos/t2454Martin Odersky2014-05-3014-0/+268
| | | | "_" type paraeters need to be given fresh names.