aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Support comma-separated enum constantsMartin Odersky2017-04-041-3/+1
| | |
| * | Change enumeration members.Martin Odersky2017-04-042-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on the discussion in #1970, enumeration objects now have three public members: - valueOf: Map[Int, E] - withName: Map[String, E] - values: Iterable[E] Also, the variance of case type parameters is now the same as in the corresponding type parameter of the enum class.
| * | Change return type of `apply`.Martin Odersky2017-04-041-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In an enum case like case C() extends P1 with ... with Pn ... apply now returns `P1 & ... & Pn`, where before it was just P1. Also, add to Option test.
| * | Check that cases with type parameters also have an extends clauseMartin Odersky2017-04-041-0/+1
| | |
| * | More fine-grained distinctions when flags are defined.Martin Odersky2017-04-041-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Flags like Trait are in fact not always defined when a symbol is created. For symbols loaded from class files, this flag, and some other is defined only once the classfile has been loaded. But this happens in general before the symbol is completed. We model this distinction by separating from the `FromStartFlags` set a new set `AfterLoadFlags` and distinguishing between the two sets in `SymDenotations#is`. Test case is enum-Option.scala. This erroneously complained before that `Enum` was not a trait.
| * | New test caseMartin Odersky2017-04-043-0/+44
| | |
| * | Link generic test to actual implementations of Enum and EnumValuesMartin Odersky2017-04-043-26/+2
| | | | | | | | | | | | These are now implemented in scala.runtime.
| * | Another testMartin Odersky2017-04-042-0/+11
| | |
| * | Add testsMartin Odersky2017-04-047-0/+47
| | |
| * | Adapt generic tests to model modified enum values schemeMartin Odersky2017-04-045-21/+35
| |/
* | 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-043-1/+28
| |/ |/| | | | | | | | | | | | | | | | | | | `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.
* | Merge pull request #2162 from abeln/infix-opDmitry Petrashko2017-04-041-0/+5
|\ \ | | | | | | Fix #1959: infix type operators in the REPL
| * | Fix #1959: infix type operators in the REPLAbel Nieto2017-04-021-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Infix type operators were broken in the REPL. The REPL uses fold methods from the untpd package, but those were skipping the operator subtree when folding over an InfixOp. Fix the issue by taking the operator into account. Tested: 1) Verified that only the REPL code uses the modified fold method. 2) Added repl test.
* | | Merge pull request #2159 from dotty-staging/fix-hashcodeDmitry Petrashko2017-04-031-4/+4
|\ \ \ | | | | | | | | Make case class hashCode take class into account
| * \ \ Merge branch 'master' into fix-hashcodeFelix Mulder2017-04-022-0/+43
| |\ \ \
| * | | | Optimize hashCode computationMartin Odersky2017-03-311-4/+4
| | | | | | | | | | | | | | | | | | | | Also, update check file.
* | | | | Merge branch 'master' into si4400Felix Mulder2017-04-021-0/+6
|\ \ \ \ \ | | |/ / / | |/| | |
| * | | | Merge pull request #2154 from dotty-staging/topic/fix-#2151Felix Mulder2017-03-311-0/+6
| |\ \ \ \ | | |_|/ / | |/| | | Fix #2151: don't die for wrong number of typeargs applied
| | * | | Fix #2151: don't die for wrong number of typeargs appliedFelix Mulder2017-03-311-0/+6
| | |/ /
* | / / Test that SI-4400 stays fixed.Dmitry Petrashko2017-03-311-0/+35
|/ / /
* / / Test that #2156 is fixedDmitry Petrashko2017-03-301-0/+37
|/ /
* | Fix #2147: redirect both java and scala std out/errFelix Mulder2017-03-294-0/+20
| |
* | Add test to check failure of non-tail recursiveFelix Mulder2017-03-291-0/+7
| |
* | Move varargs tests to top-level pos and negFelix Mulder2017-03-298-3/+3
| |
* | Add testing of new test frameworkFelix Mulder2017-03-2911-0/+56
| |
* | Add run testing capabilitiesFelix Mulder2017-03-297-73/+5
| |
* | Add neg testing capability to ParallelTestingFelix Mulder2017-03-292-2/+2
| |
* | Fix i851.java not being valid javaFelix Mulder2017-03-291-1/+1
| |
* | Merge pull request #2139 from dotty-staging/fix/false-companionGuillaume Martres2017-03-284-0/+17
|\ \ | | | | | | Fix #2137: Create dummy companions for top-level objects without a real one
| * | Fix #2137: Create dummy companions for top-level objects without a real oneGuillaume Martres2017-03-234-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we sometimes ended up forcing a companion class symbol from a previous run or from the classpath which lead to weird issues like in `false-companion`. Even if we end up not forcing such a symbol, its presence can still lead to issue: before this commit incremental compilation of `dotty-compiler-bootstrapped` was broken because we recorded a false dependency on the non-bootstrapped `dotty-compiler` jar. The added test is currently marked pending because it does not work with JUnit (which doesn't handle separate compilation), only partest. I didn't managed to get it to work right, and this won't be necessary once our testing framework is overhauled by https://github.com/lampepfl/dotty/pull/2125 anyway, so I'll just have to remember to enable this test afterwards.
* | | Merge pull request #2127 from dotty-staging/fix/variable-pattern-accessGuillaume Martres2017-03-282-0/+23
|\ \ \ | | | | | | | | Fix desugaring of variable pattern leaking into API
| * | | Fix desugaring of variable pattern leaking into APIGuillaume Martres2017-03-212-0/+23
| | | | | | | | | | | | | | | | | | | | This was especially bad for incremental compilation since the temporary variable name is unstable.
* | | | Fix varargs in methods and constructors (#2135)Igor Mielientiev2017-03-227-0/+21
| |/ / |/| | | | | | | | | | | | | | | | | * Fix varargs in methods (Issue: #1625) * Fix minor comments * Change varargs parameter message * Fix failed test, fix case for constructor
* | | Update check fileMartin Odersky2017-03-202-4/+4
| | |
* | | Add test casesMartin Odersky2017-03-206-3/+80
|/ /
* | Merge pull request #2122 from dotty-staging/fix-i2086Guillaume Martres2017-03-202-0/+9
|\ \ | | | | | | Fixed #2086: Add tests for issue that has already been fixed.
| * | Fixed #2086: Add tests for issue that has already been fixed.Nicolas Stucki2017-03-202-0/+9
| | |
* | | Merge pull request #2123 from dotty-staging/fix-i1573Guillaume Martres2017-03-203-0/+15
|\ \ \ | |/ / |/| | Fixed #1573: Add tests for fixed issue.
| * | Fixed #1573: Add tests for fixed issue.Nicolas Stucki2017-03-203-0/+15
| | |
* | | Merge pull request #2118 from abeln/super-bugDmitry Petrashko2017-03-201-0/+3
|\ \ \ | |/ / |/| | Fix #2117: bug in typechecking super prefix with invalid enclosing class
| * | Fix bug in typechecking super prefix with invalid enclosing classAbel Nieto2017-03-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When typechecking class A { C.super.foo() } If C isn't an enclosing class, the compiler was throwing because of an unguarded pattern match. Fix the issue by checking for ErrorType. Tested: Verified that the example above no longer throws. Added a test.
* | | 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.
* | | Merge pull request #2110 from dotty-staging/fix/reduce-more-lambdasGuillaume Martres2017-03-181-0/+3
|\ \ \ | | | | | | | | Reduce type lambdas even if variance changes
| * | | 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.