aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
Commit message (Collapse)AuthorAgeFilesLines
* Move failing test to pending.Martin Odersky2015-09-181-52/+0
| | | | | | The original IterableSelfRec is not syntactically legal after the hk changes. I attempted to fix, but there's still a type error. Need to investigate whether this is a true error or a bug.
* Disallow wildcard arguments to higher-kinded types...Martin Odersky2015-09-181-1/+34
| | | | ...unless the HK type can be eta-reduced to a class type.
* Eta expand type arguments corresponding to lambdasMartin Odersky2015-09-181-2/+2
| | | | | In Namer, eta expand any type argument that corresponds to a higher-kinded type parameter. Also, check that all type parameter lists are fully applied.
* Fix desugaring problemMartin Odersky2015-09-121-0/+565
| | | | Desugaring worked incorrectly when both context bounds and default parameters were present.
* Test other forms of singleton types.Martin Odersky2015-08-231-2/+18
| | | | | Tested are now other numeric values, strings, booleans, which are all legal singleton types.
* Tests of functionality.Martin Odersky2015-08-231-0/+40
| | | | | | As the comment in pos/singletons.scala says, we currently test only constant propagation during typer. We should also have a test that literalize produces the literals in the right places.
* Move the inlining of value class methods before ErasureGuillaume Martres2015-07-071-0/+37
| | | | | | | | | | | | | | | | VCInline is split into two phases: - VCInlineMethods (before Erasure) replaces value class method calls by calls to extension methods - VCElideAllocations (after Erasure) handles == and optimizing the unboxing of a boxed value class, as VCInline did before. This should not affect anything currently, but in the future we will have phases before Erasure that mangle names (like TypeSpecializer, see #630), being able to put these phases after VCInlineMethods means that VCInlineMethods does not need to know anything about how these phases mangle names, this reduces the coupling between phases. The trade-off is that VCInlineMethods needs to deal with type parameters and multiple parameter lists whereas VCInline didn't.
* Merge pull request #694 from dotty-staging/fix/dependent-methodsodersky2015-07-062-0/+47
|\ | | | | Fix/dependent methods
| * Add test from pending.Martin Odersky2015-06-251-0/+32
| |
| * Sharpen prototypes of implicit methods.Martin Odersky2015-06-251-0/+15
| | | | | | | | | | | | | | Necessary to make implicit resolution of type-level peano numbers work. The current commit makes takes the inimal steps to make this happen. We could also consider sharpening using followAlias every type we constrain a result, or every time we adapt a type.
* | Check value class member restrictionsMartin Odersky2015-07-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | According to SIP 15 a value class C must obey the following restrictions: C may not have secondary constructors. C may not declare fields (other than the parameter of a value class). C may not contain object definitions. C may not have initialization statements. These are enforced by this commit. We are still missing restrictions on value class paremeters. We should review what the right set of conditions is (probably we want to admit non-vals, and maybe even multiple parameters).
* | Merge pull request #678 from dotty-staging/fix/#670-orphan-polyparamodersky2015-06-251-0/+26
|\ \ | |/ |/| Avoid junk produced by Constraint#replace.
| * Revert test to originalMartin Odersky2015-06-231-2/+2
| | | | | | | | Uncomment two lines that were commented out by accident.
| * Avoid junk produced by Constraint#replace.Martin Odersky2015-06-221-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two instances where a constraint undergoing a replace would still refer to poly params that are no longer bound after the replace. 1. In an ordering the replaced parameters was n ot removed from the bounds of the others. 2. When a parameter refers to the replaced parameter in a type, (not a TypeBounds), the replaced parameter was not replaced. We now have checking in place that in globally committable typer states, TypeVars are not instantiated to PolyParams and (configurable) that constraints of such typer states are always closed. Fixes #670.
* | Merge pull request #668 from lampepfl/fix/#650-self-typesodersky2015-06-221-0/+5
|\ \ | |/ |/| Fix checking whether types are instantiable.
| * Fix checking whether types are instantiable.Martin Odersky2015-06-191-0/+5
| | | | | | | | | | The logic for checking aginst the self type was wrong, as demonstrated by pos/checkInstantiable.scala.
* | Add test that succeedsMartin Odersky2015-06-191-0/+8
| |
* | Merge pull request #599 from dotty-staging/add/existential-skolemizationodersky2015-06-191-0/+20
|\ \ | |/ |/| Tighten comparison of skolem types
| * Deskolemize types inferred for vals and defsMartin Odersky2015-06-061-0/+20
| | | | | | | | | | | | | | We want to establish the invariant (optionally checked by assertNoSkolems) that symbols do not contain skolemized types as their info. This avoids unsoundness situations where a skolem gets exported as part if the result type of a method, so different instantiations look like their are the same instance.
* | Merge pull request #635 from dotty-staging/fix/private-scala2-trait-settersDmitry Petrashko2015-06-122-4/+10
|\ \ | | | | | | Some fixes around mixin and memoization
| * | Copy annotations from trait members to their implementationsMartin Odersky2015-06-081-1/+7
| | | | | | | | | | | | Implementations inherit all annotations on the implemented trait methods.
| * | Fix to trait setter generationMartin Odersky2015-06-081-3/+3
| |/ | | | | | | | | The logic to add trait setters to Scala 2 traits was wrong. This led to AbstractMethodErrors in the formerly commented out part of scala-trait.scala.
* | Fix mergeDenot one more time.Martin Odersky2015-06-072-0/+46
| | | | | | | | | | | | | | | | | | | | It's easy to get this wrong. What happened was that when computing deferred members of a class a deferred member was preferred over a concrete one because the types did not match. Thsi should not happen. We now change the scheme to always prefer concrete over abstract, and subclass-owned over superclass-owned. But we pick a denotation only if the overrides relationship on types coincides with the preference on symbols.
* | Bring back tests from disabled.Martin Odersky2015-06-073-0/+52
| | | | | | | | The tests in this commit pos were verified to work again.
* | Fix refs to inner objectsMartin Odersky2015-06-071-0/+16
|/ | | | | | | | A reference to an object from anywhere in its module class can be established by the This of the module class. The previous behavior always referenced the object as a term ref which might cause a reference to the outer This which might not be available (since this is not tracked by ExplicitOuter). Brings t3174.scala back from disabled.
* Merge pull request #622 from dotty-staging/add/implement-scala2-traitsodersky2015-06-062-0/+58
|\ | | | | Implement Scala2 traits
| * Add test case.Martin Odersky2015-06-012-0/+58
| | | | | | | | We are still lacking the setup to do this right for mixed Scala 2/Dotty runtime tests. So I checked into `pos` for now.
* | Test case for problems with lambda lifting.Martin Odersky2015-06-031-0/+9
| |
* | Move test from lambdaLift.scala to a separate file in pending.Dmitry Petrashko2015-06-021-21/+0
|/
* Uncomment testsMartin Odersky2015-05-271-2/+2
|
* Introduce harmonization of numeric argumentsMartin Odersky2015-05-271-0/+28
| | | | | | | | | | | | | | Harmonization is Dotty's alternative to Scala 2's notion of weak conformance. It is less powerful but also less entangled with the core type system. The idea is that in some specific contexts trees that all have primitive numeric types will be converted as necessary so that they all have the same numeric type. These tree sets are: - the two branches of an if - the alternatives of a match - the body together with the catch blocks of a try - the arguments of a vararg parameter Examples are in the test file, harmonize.scala.
* New pos testsMartin Odersky2015-05-275-0/+62
| | | | Some of them were moved from disabled after verifiying that they compile now.
* Calibrate findMember logging thresholds and test caseMartin Odersky2015-05-211-0/+52
| | | | | | | | | | | | Adds IterableSelfRec.scala which caused lockup of the compiler. After a lot of work the problem was determined to be polyomial or exponential behavior of the compiler when executing findMember on refined types that contain several bindings where the resutling & causes a recursive invokation of findMember with the same name. We do have a stop for this now, but if the stop comes too late the runtime will grow very fast. Problem addressed by kiccking in earlier with the stopping logic.
* Add test case for higher-kinded operations on collectionsMartin Odersky2015-05-211-0/+52
| | | | The test case that caused all previous commits in this branch.
* Make normalizeToRef survive annotated typesMartin Odersky2015-05-211-1/+1
| | | | Did not handle this case before.
* Disallow {...} arguments for annotationsMartin Odersky2015-05-211-0/+13
| | | | | This mimics scalac's behavior (but not the official syntax; in fact the official syntax seems to be ambiguous.
* Fix null unboxing of primitives (fixes #582)Guillaume Martres2015-05-181-11/+0
| | | | | Erasure#isUnbox was incorrect: the unbox methods are defined on the value classes, not the boxed classes.
* As i566 shows, it is possible to have a package as prefix, a packageMartin Odersky2015-05-151-0/+5
| | | | | | | | | | object as owner and be followed by type arguments: reflect.classTag[T] expands to reflect.`package`.classTag[T]
* Merge pull request #551 from dotty-staging/fix/#547-overloaded-varargsDmitry Petrashko2015-05-091-0/+4
|\ | | | | Fix #547: Vararg overload
| * Fix #547: Vararg overloadMartin Odersky2015-05-081-0/+4
| | | | | | | | | | When comparing to types in isAsSpecific, onvert repeated parameters to their underlying type only if both types are vararg methods. This mimics scalac behavior.
* | Merge pull request #543 from dotty-staging/compile-dottyodersky2015-05-091-0/+3
|\ \ | | | | | | Make dotty compile backend.
| * | Drop the requirement that extractors with `get` must implement ProductMartin Odersky2015-05-081-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | We used to require that the result type of an extractor `get` is a product, or else the type of the `get` itself would be taken as the result type of the unapply. This is now relaxed so that we automatically select with _1, _2, ... as soon as there are multiple argument patterns, and (1) the result type is not a Seq, (2) the number of consecutive product conselectors matches the number of arguments.
| * | Fix #536 - only load member classes of classes that are currently compiled.Martin Odersky2015-05-071-0/+3
| | | | | | | | | | | | | | | | | | | | | It seems wasteful to load the member classes even of classes that are not currently compiled. It also makes us vulnerable to any misinterpretation of Java file formats. In th particular case of #536, we parsed a class an anonymous Collection$1 which was referring to the type parameter of its enclosing class, but was not diagnosed as an inner class of the enclosing class.
* | | Merge pull request #542 from dotty-staging/fix/#540-unbounded-generic-arrayDmitry Petrashko2015-05-081-0/+6
|\ \ \ | |_|/ |/| | Fix #540 - unbounded array test for wildcard array arguments
| * | Fix #540 - unbounded array test for wildcard array argumentsMartin Odersky2015-05-061-0/+6
| |/ | | | | | | | | | | Arrays with wildcard arguments such as Array[_ <: Foo] where Foo is a universal trait are now diagnosed as unbounded generic arrays and are erased to Object.
* / Drop the requirement that extractors with `get` must implement ProductMartin Odersky2015-05-051-0/+32
|/ | | | | | | | | We used to require that the result type of an extractor `get` is a product, or else the type of the `get` itself would be taken as the result type of the unapply. This is now relaxed so that we automatically select with _1, _2, ... as soon as there are multiple argument patterns, and (1) the result type is not a Seq, (2) the number of consecutive product conselectors matches the number of arguments.
* Merge pull request #534 from dotty-staging/fix/computeDenotodersky2015-05-051-0/+6
|\ | | | | Fix #518 - compute denotations
| * Add test caseMartin Odersky2015-05-041-0/+6
| | | | | | | | Tests #518.
* | Merge pull request #509 from dotty-staging/add/expandSAMsDmitry Petrashko2015-05-042-0/+80
|\ \ | | | | | | Expand SAM closures to anonymous classes if needed
| * | More conditions under which SAMs are converted to anonymous classesMartin Odersky2015-05-021-0/+12
| | | | | | | | | | | | | | | | | | | | | Also included are - Closures implementing classes that inherit from a class other than Object - Closures that implement traits which run initialization code.