aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | 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 #2058 from dotty-staging/fix-2054liu fengyun2017-03-181-0/+13
|\ \ \ | |/ / |/| | Fix #2054
| * | Test that #2054 is fixed.Dmitry Petrashko2017-03-071-0/+13
| | |
* | | Fix #2099: avoid loading a private member when recomputing a NamedType denotGuillaume Martres2017-03-163-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ParamForwarding creates the following forwarder in B: private[this] def member: Int = super.member Where the type for `super.member` is `TermRef(SubA, member)` and the symbol is the `val member` in `A`. So far this is correct, but in later phases we might call `loadDenot` on this `TermRef` which will end up calling `asMemberOf`, which before this commit just did: prefix.member(name) This is incorrect in our case because `SubA` also happens to have a private `def member`, which means that our forwarder in B now forwards to a private method in a superclass, this subsequently crashes in `ExpandPrivate`. (Note: in the bytecode, a private method cannot have the same name as an overriden method, but this is already worked around in EnsurePrivate.) The fix is simple: when we recompute a member, we should only look at private members if the previous denotation was private.
* | | Merge pull request #2096 from dotty-staging/fix-i2051Dmitry Petrashko2017-03-152-0/+11
|\ \ \ | | | | | | | | Fix #2051: allow override T with => T or ()T
| * | | add more testsliu fengyun2017-03-141-0/+7
| | | |
| * | | add neg test for #2051liu fengyun2017-03-141-0/+2
| | | |
| * | | fix #2051: allow override T with => T or ()Tliu fengyun2017-03-141-0/+2
| | | |
* | | | Merge pull request #2079 from dotty-staging/depmeth2odersky2017-03-142-0/+28
|\ \ \ \ | | | | | | | | | | Allow inter-parameter dependencies
| * | | | Test casesMartin Odersky2017-03-142-0/+28
| | | | |
* | | | | Merge pull request #2098 from dotty-staging/fix-i1960Guillaume Martres2017-03-141-0/+8
|\ \ \ \ \ | | | | | | | | | | | | Fix #1960: add test
| * | | | | add test for #1960liu fengyun2017-03-141-0/+8
| | |/ / / | |/| | |
* | | | | Merge pull request #2097 from dotty-staging/fix-i1706Guillaume Martres2017-03-141-0/+3
|\ \ \ \ \ | | | | | | | | | | | | Fix #1706: add test
| * | | | | add test for #1706liu fengyun2017-03-141-0/+3
| |/ / / / | | | | | | | | | | | | | | | The bug is already fixed in PR #1724 while fixing another issue
* | | | | Merge pull request #2091 from dotty-staging/fix-#2077Guillaume Martres2017-03-142-0/+11
|\ \ \ \ \ | |_|/ / / |/| | | | Fix #2077: Optimization of constant conditionals
| * | | | Fix #2077: Optimization of constant conditionalsMartin Odersky2017-03-132-0/+11
| |/ / / | | | | | | | | | | | | | | | | Move fixed logic to FirstTransform, where the other constant folding operations are also done.
* / / / fix #2071: handle HKApply in SAMTypeliu fengyun2017-03-141-0/+7
|/ / /
* | | Merge pull request #2080 from dotty-staging/fix#-2066odersky2017-03-122-0/+42
|\ \ \ | | | | | | | | Fix #2066: Don't qualify private members in SelectionProto's...
| * | | Alternative fix of #2066.Martin Odersky2017-03-121-0/+27
| | | | | | | | | | | | | | | | | | | | Now we never match `? { name: T }` with types that have only a private `name` member. This is what scalac does, too.
| * | | 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.
* | | | Merge pull request #2078 from dotty-staging/fix-#1569-v2Guillaume Martres2017-03-122-9/+12
|\ \ \ \ | | | | | | | | | | Fix #360: Improve avoidance algorithm
| * | | | Add original test case of #360Martin Odersky2017-03-121-0/+6
| | | | |
| * | | | Fix #1569: Improve avoidance algorithmMartin Odersky2017-03-122-9/+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 #2076 from dotty-staging/fix/override-java-varargsodersky2017-03-122-0/+8
|\ \ \ \ | | | | | | | | | | Fix overriding a Java method with varargs
| * | | | Fix overriding a Java method with varargsGuillaume Martres2017-03-122-0/+8
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If A method like: override def foo(x: Object*) overrides a Java method, it needs to be rewritten as: def foo(x: Seq[Object]) override def foo(x: Array[Object]): Object = foo(Predef.wrapRefArray(x)) This should be handled by ElimRepeated but there were two bugs: - `addVarArgsBridge` was called at phase `thisTransformer.next`, this is too late to create the bridge since `T*` has already been rewritten as `Seq[T]` - The original method symbol needs to have the `override` flag dropped, since it doesn't override anything. Furthermore, RefChecks had to be moved after ElimRepeated, otherwise the testcase would fail the overriding checks.
* / / / Move tests/tasty/* to tests/pickling/*Guillaume Martres2017-03-112-0/+0
|/ / / | | | | | | | | | | | | These two directories were tested using the same flags, but tests/tasty compiled all of its files at once which is usually not what is intended.
* | | 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-0912-1/+330
|\ \ \ \ | | | | | | | | | | Fix type inference for HLists and HMaps
| * | | | Adress reviewers commentsMartin Odersky2017-03-031-1/+7
| | | | |
| * | | | More testsMartin Odersky2017-03-022-0/+42
| | | | | | | | | | | | | | | | | | | | and a typo fixed
| * | | | New test: covariant hmapsMartin Odersky2017-03-021-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Type inference tends to take quite different paths for non-variant and variant data structures. Since, non-variant hmap has already exposed quite a few problems, it's good to test it also in the covariant case.
| * | | | Move depmeth tests back to pendingMartin Odersky2017-03-012-0/+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.
| * | | | Drop duplication in testMartin Odersky2017-03-011-71/+0
| | | | |
| * | | | Add non-variant version of HLists for completenessMartin Odersky2017-02-282-0/+157
| | | | | | | | | | | | | | | | | | | | | | | | | Variance changes quite a few things for type inference, so it's good to check a non-variant version as well.
| * | | | Add check fileMartin Odersky2017-02-281-0/+1
| | | | |
| * | | | Re-instantiate depmeth testsMartin Odersky2017-02-284-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | These now compile with the changes to dependent methods, except for one which is invalid under dotty.
| * | | | Independent test case, mentioned in #2004.Martin Odersky2017-02-281-0/+11
| | | | |
| * | | | New testMartin Odersky2017-02-282-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | The HLists test brought out the unsoundness of alias rewriting in glbs which is tackled in the last commit.
* | | | | Merge pull request #2065 from dotty-staging/change-implicit-conv2odersky2017-03-099-9/+34
|\ \ \ \ \ | | | | | | | | | | | | Disallow subtypes of Function1 acting as implicit conversions
| * | | | | Drop special case around Function1Martin Odersky2017-03-085-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | Add puzzler 54 as a testMartin Odersky2017-03-081-0/+13
| | | | | |
| * | | | | Disallow subtypes of Function1 acting as implicit conversionsMartin Odersky2017-03-084-3/+13
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* / | | | Fix #2067: Compute defKind at Typer, not NamerMartin Odersky2017-03-081-0/+3
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | It's hard to predict for defKind all the desugarings that can be applied to a definition. Better to do it once the desugarings have been applied. NoInit and PureInterface are both tested only after Typer, so it's OK to delay their initialization until regular Typer.
* | | | Don't set PureInterface when a default param is presentGuillaume Martres2017-03-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default param will be desugared into a method with a body, so setting PureInterface would be wrong. The enclosed test previously failed with a pickling difference, because the unpickler correctly decided to not set the PureInterface flag since it saw the default param method. This fixes the tasty_dotc_util which failed since the last commit because FreshNameCreator was now incorrectly recognized as a PureInterface.
* | | | Disable most tests that depend on scala-reflectGuillaume Martres2017-03-086-0/+0
| |/ / |/| |
* | | Merge pull request #2059 from dotty-staging/fix/inline-EmptyTreeodersky2017-03-071-0/+13
|\ \ \ | |_|/ |/| | Fix #2056: Backend crash when inlined method contains try
| * | 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.