aboutsummaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
* Don't align aliases in refined types by defaultMartin Odersky2017-02-282-14/+34
| | | | | | | | | | | We previously tried to force S1 and S2 be the same type when encountering a lub like `T1 { A = S1 } & T2 { A = S2 }`. The comments in this commit explain why this is unsound, so this rewrite is now made subject to a new config option, which is off by default. I verified that the new behavior does not affect the performance of the junit tests.
* Systematic treatment of result types of dependent methodsMartin Odersky2017-02-283-31/+32
| | | | | | We approximate dependencies to parameters by Wildcards. This was already done in one place, is now done in other places as well, instead of doing nothing for dependent methods.
* Constrain results of dependent implicitsMartin Odersky2017-02-281-14/+9
| | | | | No reason why we should not - normalize handles implicit methods just fine. This fixes type errors in test HLists.scala.
* Fix printing of refined applied typesMartin Odersky2017-02-282-2/+4
| | | | | | If an applied type has a refinement, it was printed before as one large refinement type including the type parameter bindings.
* Merge pull request #2035 from dotty-staging/fix-#2033Guillaume Martres2017-02-281-1/+10
|\ | | | | Fix #2033: Improve handling of unresolved overloaded arguments
| * Fix #2033: Improve handling of unresolved overloaded argumentsMartin Odersky2017-02-271-1/+10
| |
* | Remove wrapArrayMethodName from defn.Nicolas Stucki2017-02-271-7/+0
|/ | | | Note that it is never used and the same method exists in transform.TreeGen
* Merge pull request #2027 from dotty-staging/fix-tests-eclipseodersky2017-02-251-1/+1
|\ | | | | Fix import which produces flakey test results on Eclipse
| * Fix import which produces flakey test resultsMartin Odersky2017-02-251-1/+1
| | | | | | | | | | Previous import gave test errors under eclipse. Probably due to some stray directory on the classpath.
* | Merge pull request #1993 from dotty-staging/add-lazy-implicitsodersky2017-02-255-9/+50
|\ \ | | | | | | Treat implicit by-name arguments as lazy values
| * | Fix typosMartin Odersky2017-02-211-3/+3
| | |
| * | PolishingMartin Odersky2017-02-181-5/+2
| | |
| * | Treat implicit by-name arguments as lazy valuesMartin Odersky2017-02-175-9/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the previous rules, the two test cases produce a diverging implicit expansion. We avoid this by creating for every implicit by-name argument of type T a lazy implicit value of the same type. The implicit value is visible for all nested implicit searches of by-name arguments. That way, we tie the knot and obtain a recursive lazy value instead of a diverging expansion.
* | | Merge pull request #2017 from dotty-staging/refchecks-less-slowodersky2017-02-251-2/+8
|\ \ \ | |_|/ |/| | Make resolveSuper less slow
| * | ResolveSuper: MixinOps save 2-3 seconds on stdlib compilation.Dmitry Petrashko2017-02-211-2/+8
| | | | | | | | | | | | | | | By ordering tests in a smarter way. Add leave a big scary comment.
* | | Merge pull request #2026 from dotty-staging/fix-#2001odersky2017-02-241-15/+8
|\ \ \ | | | | | | | | Better error messages for missing type of recursive definitions
| * | | Fix indentationMartin Odersky2017-02-231-4/+4
| | | |
| * | | Better error messages for missing type of recursive definitionsMartin Odersky2017-02-231-11/+4
| | | |
* | | | Merge pull request #2015 from dotty-staging/add-pf-overloadingodersky2017-02-233-27/+29
|\ \ \ \ | |/ / / |/| | | Add overloading support for case-closures
| * | | Drop stray printlnMartin Odersky2017-02-211-1/+1
| | | |
| * | | Extend argument pretyping to case-closuresMartin Odersky2017-02-213-32/+27
| | | |
| * | | Add overloading support for case-closuresMartin Odersky2017-02-211-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | case-closures (which are represented as Match nodes) have a known arity just like other function literals. So shape analysis for overloading resolution should apply to them as well.
* | | | Merge pull request #2012 from ennru/ennru_CantInstantiateAbstractFelix Mulder2017-02-224-2/+63
|\ \ \ \ | | | | | | | | | | Change 'is abstract; cannot be instantiated' to Message
| * | | | Added explanation for CantInstatiateAbstractClassOrTraitEnno Runne2017-02-221-1/+12
| | | | |
| * | | | Change 'is abstract; cannot be instantiated' to MessageEnno Runne2017-02-204-2/+52
| | | | |
* | | | | Merge pull request #2021 from dotty-staging/fix-#2020Guillaume Martres2017-02-221-1/+7
|\ \ \ \ \ | | | | | | | | | | | | Fix #2020: Only the first parameters of a case class are caseaccessors
| * | | | | Fix #2020: Only the first parameters of a case class are caseaccessorsMartin Odersky2017-02-221-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only the parameters in the first parameter list of a case class should get the `CaseAccessor` flag. Fixes #2020.
* | | | | | Fix #2009: Fix placeholder params logic for lambdas (#2019)odersky2017-02-221-7/+9
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix #2009: Fix placeholder params logic for lambdas Logic was missing placeholders in rhs of lambdas. * Add comment * Fix typo
* | | | | Merge pull request #2014 from dotty-staging/fix-#2002odersky2017-02-222-1/+2
|\ \ \ \ \ | | | | | | | | | | | | Fix #2000: Make implicit and non-implicit functions incomparable
| * | | | | Fix test ^ 2Martin Odersky2017-02-211-1/+1
| | | | | |
| * | | | | Fix testMartin Odersky2017-02-211-1/+1
| | | | | |
| * | | | | Fix #2000: Make implicit and non-implicit functions incomparable with <:<Martin Odersky2017-02-212-1/+2
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implicit and non-implicit functions are incomparable with <:<, but are treated as equivalent with `matches`. This means implicit and non-implicit functions of the same types override each other, but RefChecks will give an error because their types are not subtypes. Also contains a test for #2002.
* | | | | Merge pull request #1997 from dotty-staging/fix-#1992odersky2017-02-222-2/+2
|\ \ \ \ \ | | | | | | | | | | | | Fix off-by-one error in forward reference checking
| * | | | | Fix off-by-one error in forward reference checkingMartin Odersky2017-02-182-2/+2
| | | | | |
* | | | | | Merge pull request #1974 from dotty-staging/fix/ctx-captureodersky2017-02-2113-59/+87
|\ \ \ \ \ \ | | | | | | | | | | | | | | Avoid accidental captures of Context
| * | | | | | TempClassInfo#addSuspension: do not capture ContextGuillaume Martres2017-02-202-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This capture did not cause any problem since we always called TempClassInfo#finalize with the same Context than we captured in `addSuspension`, but it's better to be explicit about these things.
| * | | | | | adjustModuleCompleter: Avoid capturing ContextGuillaume Martres2017-02-201-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we computed the scope in `findModuleBuddy` using `this.effectiveScope`, this means that we captured `this` which has a self-type of `Context`, replacing it by `ctx.effectiveScope` would be wrong since we are interested in the scope at the time `adjustModuleCompleter` was called, not the scope at the time the completer is called. Therefore, we have to eagerly compute `this.effectiveScope` so that we don't capture the Context but can use the right scope in `findModuleBuddy`. We also move `findModuleBuddy` to a companion object to avoid accidental captures of `this`. This capture lead to crashes in the IDE.
| * | | | | | Annotation#deferredSymAndTree: make sure symbol is valid in current runGuillaume Martres2017-02-191-1/+1
| | | | | | |
| * | | | | | ImportInfo: removed ctx parameter from constructorGuillaume Martres2017-02-194-19/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ImportInfo#toString required the ctx parameter,so it was replaced by ImportInfo#toText.
| * | | | | | ClassfileParser: avoid looking up inner class in wrong phaseGuillaume Martres2017-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getMember needs to take an implicit `Context` parameter, otherwise the following code: val result = ctx.atPhaseNotLaterThan(ctx.typerPhase) { implicit ctx => getMember(owner, innerName.toTypeName) } will not run getMember at the typer phase.
| * | | | | | TreeUnpickler: do not capture Context in Annotation symbolGuillaume Martres2017-02-182-5/+13
| | | | | | |
| * | | | | | TreeUnpickler: do not capture Context in Annotation treeGuillaume Martres2017-02-181-1/+1
| | | | | | |
| * | | | | | TreeUnpickler: Avoid capturing context in lazyStatsGuillaume Martres2017-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `lazyStats` creates a lazy tree using `readLater`, but the closure inside `readLater` calls `mergeTypeParamsAndAliases` which until this commit implicitly used the Context from the outer method `readTemplate`, this lead to crashes in the Language Server.
| * | | | | | ImportInfo: Do not capture ContextGuillaume Martres2017-02-182-7/+7
| | | | | | |
| * | | | | | typedUnApply#trySelectUnapply: small cleanupGuillaume Martres2017-02-181-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, `specificProto` was a def even though it is always called, this is because in cece884812143c6c8090ce08c6321bd4a1d52ea6, the usages of `specificProto` and `genericProto` were swapped. We fix this by only defining the protos where they are used. Incidentally, this mean that the calls to UnapplyFunProto will use the correct Context inside `tryEither`, although in this case this shouldn't matter.
| * | | | | | typedApply: Avoid using incorrect context in tryEitherGuillaume Martres2017-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the following code accidentally used the implicit Context parameter of `typedApply`: tryEither { implicit ctx => typedOpAssign
| * | | | | | TailRec: Avoid harmless capture of ContextGuillaume Martres2017-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The captured context was passed implicitly to dd.rhs, atGroupEnd is always run with the same runId as the captured context so this should be okay, but it's better to avoid using two contexts in the same expression anyway.
| * | | | | | deferredAnnot: Avoid harmless capture of ContextGuillaume Martres2017-02-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The capture context was only used to get its phase so shouldn't cause any problem.
* | | | | | | Merge pull request #1984 from dotty-staging/fix-#1747-v2odersky2017-02-216-11/+25
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix #1747: Improve error message for Scala/Java type mismatch
| * | | | | | | Unrelated cleanup: Make SearchResult sealed.Martin Odersky2017-02-151-1/+1
| | | | | | | |