aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
Commit message (Collapse)AuthorAgeFilesLines
* Add testMartin Odersky2017-04-181-0/+13
|
* Merge pull request #2209 from dotty-staging/fix-#2152odersky2017-04-131-0/+7
|\ | | | | Fix #2152: Instantiate dependent result type parameters
| * Fix #2152: Instantiate dependent result type parametersMartin Odersky2017-04-111-0/+7
| | | | | | | | | | | | | | #2152 shows that dependent result type parameters can end up in the types of terms, so we have to eliminate them. If we don't we get orphan parameters in pickling. Fix method name and comment
* | Merge pull request #2225 from dotty-staging/fix-#2192odersky2017-04-111-0/+19
|\ \ | | | | | | Fix #2212: Avoid imports in the wrong namespace
| * | Fix #2212: Avoid imports in the wrong namespaceMartin Odersky2017-04-111-0/+19
| | | | | | | | | | | | | | | | | | Don't issue an error if when considering a named import that refers to a valoe or type which does not exist. Instead, disregard the import an continue.
* | | Add fullyDefinedType for class parent typesMartin Odersky2017-04-111-0/+9
| |/ |/| | | | | | | | | If we do not do that, any type variables in the parent type get interpolated later, when the whole primary constructor is typed. But by then we miss the context of what their variance was.
* | Fix #2219: Fix type applications on WildcardTypeGuillaume Martres2017-04-111-0/+7
| | | | | | | | | | | | | | Previously we just returned the unapplied WildcardType which is incorrect if the WildcardType is bounded. The proper thing to do is to do the type application on the bounds of the WildcardType and wrap the result in a WildcardType.
* | Merge pull request #1938 from dotty-staging/named-based-patmatFelix Mulder2017-04-111-0/+7
|\ \ | | | | | | Change case class desugaring and decouple Products and name-based-pattern-matching
| * | Add testsOlivier Blanvillain2017-04-061-0/+7
| | | | | | | | | | | | | | | | | | - t7296 & case-class-23 are moved out of pending - 1938 tests productElement > 23
* | | Merge pull request #2206 from dotty-staging/fix-#2198odersky2017-04-101-0/+6
|\ \ \ | | | | | | | | Fix #2198: Don't widen module singletons
| * | | Fix #2198: Don't widen module singletonsMartin Odersky2017-04-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since module classes are a compiler-generated construct that's not directly visible to programmers, it seems better not to automatically widen a module singleton to its underlying class. Fixes #2198.
* | | | Merge pull request #2207 from dotty-staging/fix-#2188Nicolas Stucki2017-04-091-0/+5
|\ \ \ \ | | | | | | | | | | Fix #2188: Do cbn transform also on Selects
| * | | | Fix #2188: Do cbn transform also on SelectsMartin Odersky2017-04-091-0/+5
| |/ / / | | | | | | | | | | | | These can arise as a result of an explicit outer transform.
* | | | Merge pull request #2208 from dotty-staging/fix-#2192Guillaume Martres2017-04-091-0/+7
|\ \ \ \ | | |_|/ | |/| | Fix #2192: Follow supertypes when determining whether an expect type …
| * | | Fix #2192: Fullow supertypes when determining whether an expect type is a ↵Martin Odersky2017-04-091-0/+7
| |/ / | | | | | | | | | function type
* | | Merge pull request #2205 from dotty-staging/fix-#2220odersky2017-04-092-0/+10
|\ \ \ | |/ / |/| | Fix #2220: Change handling of package objects and tweak hk type inference
| * | Tweak logic for hk type comparisonsMartin Odersky2017-04-092-0/+10
| |/
* / Fix #2201: Less aggressive type application reduction for better inferenceGuillaume Martres2017-04-083-0/+33
|/ | | | | | | | | | | | | | | | | | | | | | | Previously we believed that reducing type applications did not affect type inference as long as the reduced type constructor had the same arity as the unreduced one, for example reducing `Foo[X, Y]` is fine when `Foo` is defined as: type Foo[A, B] = Bar[A, B] but not when it's defined as: type Foo[A] = Bar[A, A] But this is not a sufficient condition: the bounds of the type constructor arguments also matter for type inference, so we need to be more strict and disallow reductions in cases like: type Foo[A, B] = Bar[B, A] and: type Foo[A, B] = Bar[A, Int]
* Merge pull request #1958 from dotty-staging/add-enumodersky2017-04-061-0/+14
|\ | | | | Add "enum" construct
| * New test caseMartin Odersky2017-04-041-0/+14
| |
* | Merge pull request #2025 from dotty-staging/fix-2024Nicolas Stucki2017-04-052-1/+5
|\ \ | | | | | | Fix #2024: TypeApply can be a final apply of a recursive method.
| * | Remove name clash in test.Dmitry Petrashko2017-03-131-1/+1
| | |
| * | Check that #2024 is fixed.Dmitry Petrashko2017-03-081-0/+4
| | |
* | | checkNoPrivateLeaks: Do not allow types to refer to leaky aliasesGuillaume Martres2017-04-042-1/+15
| |/ |/| | | | | | | | | | | | | | | | | | | `checkNoPrivateLeaks` can force a lot of things, this lead to hard-to-reproduce issues in unpickling because we called `checkNoPrivateLeaks` on the type parameters of a class before anything in the class was indexed. We fix this by making sure that `checkNoPrivateLeaks` never transforms type symbols, only term symbols, therefore we can unpickle type parameters without forcing too many things. tests/neg/leak-type.scala illustrates the new restriction that this necessitates.
* | Move varargs tests to top-level pos and negFelix Mulder2017-03-292-0/+0
| |
* | Fix i851.java not being valid javaFelix Mulder2017-03-291-1/+1
| |
* | Fix varargs in methods and constructors (#2135)Igor Mielientiev2017-03-222-0/+6
| | | | | | | | | | | | | | * Fix varargs in methods (Issue: #1625) * Fix minor comments * Change varargs parameter message * Fix failed test, fix case for constructor
* | Better type inference in harmonizeUnionGuillaume Martres2017-03-181-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, the added testcase failed because the type of `inv` was inferred to be `Inv[Any]` instead of `Inv[Int]`. The situation looks like this: def inv(cond: Boolean) = if (cond) new Inv(1) // : Inv[A] where A >: Int else Inv.empty // : Inv[A'] where A' unconstrained // : Inv[A] | Inv[A'] To get the type of `inv`, we call `harmonizeUnion` which will take the lub of `Inv[A]` and `Inv[A']`, eventually this mean that we do: A' <:< A But since `harmonizeUnion` uses `fluidly`, this does not result in `A'` getting constrained to be a subtype of `A`, instead we constrain `A` to the upper bound of `A'`: Any <:< A We use `fluidly` to avoid creating OrTypes in `lub`, but it turns out that there is a less aggressive solution: `lub` calls `mergeIfSuper` which then calls `isSubTypeWhenFrozen`, if we just make these subtype calls non-frozen, we can achieve what we want. This is what the new `lub` parameter `canConstrain` allows.
* | Reduce type lambdas even if variance changesGuillaume Martres2017-03-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the added testcase failed with (when running with -Ydebug-alias): 2 | def foo = Seq(a) | ^ |covariant type A occurs in invariant position in type => Seq.CC[Cov.this.A] of method foo Because the type parameter of `CC` is invariant. Of course, this is fine because `CC[A]` can be reduced to `Seq[A]`, but before this commit, `TypeApplications#appliedTo` used to disallow reductions that replaced an invariant type parameter with a variant one. I believe that for type inference, only preserving the arity is important, so I removed this restriction.
* | Merge pull request #2096 from dotty-staging/fix-i2051Dmitry Petrashko2017-03-151-0/+9
|\ \ | | | | | | Fix #2051: allow override T with => T or ()T
| * | add more testsliu fengyun2017-03-141-0/+7
| | |
| * | fix #2051: allow override T with => T or ()Tliu fengyun2017-03-141-0/+2
| | |
* | | Test casesMartin Odersky2017-03-141-0/+15
| | |
* | | fix #2071: handle HKApply in SAMTypeliu fengyun2017-03-141-0/+7
|/ /
* | Merge pull request #2080 from dotty-staging/fix#-2066odersky2017-03-121-0/+15
|\ \ | | | | | | Fix #2066: Don't qualify private members in SelectionProto's...
| * | Fix #2066: Don't qualify private members in SelectionProto's...Martin Odersky2017-03-121-0/+15
| | | | | | | | | | | | ... unless they would be accessible in the given context.
* | | Add original test case of #360Martin Odersky2017-03-121-0/+6
| | |
* | | Fix #1569: Improve avoidance algorithmMartin Odersky2017-03-121-0/+6
|/ / | | | | | | | | | | The essential change is that we do not throw away more precise info of the avoided type if the expected type is fully defined.
* | Merge pull request #2070 from dotty-staging/fix/erasedLubodersky2017-03-091-0/+15
|\ \ | | | | | | Fix bug in erasedLub leading to incorrect signatures
| * | Fix bug in erasedLub leading to incorrect signaturesGuillaume Martres2017-03-081-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, the added testcase failed in a strange way: 14 | def bla(foo: Foo) = orElse2(identity).apply(foo) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |value of type <nonsensical><notype></nonsensical> does not take parameters This happened because the TermRef for the apply method had an incorrect signature, therefore its underlying type was NoType. According to the documentation of `erasedLub`, the erasure should be: "a common superclass or trait S of the argument classes, with the following two properties: S is minimal: no other common superclass or trait derives from S] S is last : in the linearization of the first argument type `tp1` there are no minimal common superclasses or traits that come after S. (the reason to pick last is that we prefer classes over traits that way)." I'm not convinced that the implementation satisfies either of these two properties, but this commit at least makes S closer to being minimal by making sure that the last best candidate never derives from it.
* | | Merge pull request #2068 from dotty-staging/fix-#2064odersky2017-03-091-0/+15
|\ \ \ | | | | | | | | Fix #2064: Avoid illegal types in OrDominator
| * | | Fix #2064: Avoid illegal types in OrDominatorMartin Odersky2017-03-081-0/+15
| | |/ | |/| | | | | | | | | | Need to skip type bounds in `underlying` chain, since TypeBounds is not a legal operand type for OrType.
* | | Merge pull request #2045 from dotty-staging/fix-hlist-hmapodersky2017-03-093-0/+76
|\ \ \ | | | | | | | | Fix type inference for HLists and HMaps
| * | | More testsMartin Odersky2017-03-022-0/+42
| | | | | | | | | | | | | | | | and a typo fixed
| * | | Move depmeth tests back to pendingMartin Odersky2017-03-012-149/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I believe this worked only accidentally because we matched more things with wildcards which turned out to be flawed. The test errors show some funky _#_ types, so not sure whether the tests are still valid or not. Moved back to pending awaiting further resolution.
| * | | Re-instantiate depmeth testsMartin Odersky2017-02-283-0/+183
| | | | | | | | | | | | | | | | | | | | These now compile with the changes to dependent methods, except for one which is invalid under dotty.
* | | | Drop special case around Function1Martin Odersky2017-03-083-91/+1
| | | | | | | | | | | | | | | | | | | | | | | | Now only Scala2 mode treats Function1's as implicit conversions. Instead we introduce a new subclass ImplicitConverter of Function1, instances of which are turned into implicit conversions.
* | | | Disallow subtypes of Function1 acting as implicit conversionsMartin Odersky2017-03-081-0/+3
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | The new test `falseView.scala` shows the problem. We might create an implicit value of some type that happens to be a subtype of Function1. We might now expect that this gives us an implicit conversion, this is most often unintended and surprising. See the comment in Implicits#discardForView for a discussion why we picked the particular scheme implemented here.
* | | Disable most tests that depend on scala-reflectGuillaume Martres2017-03-083-46/+0
| |/ |/|
* | Fix #2056: Backend crash when inlined method contains tryGuillaume Martres2017-03-071-0/+13
|/ | | | | | In various places we do "case EmptyTree =>", since Tree#equals uses reference equality this means that EmptyTree should never be copied, otherwise some other code path will be taken.