aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2014 from dotty-staging/fix-#2002odersky2017-02-224-1/+29
|\ | | | | 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-214-1/+29
| | | | | | | | | | | | | | | | | | 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-224-2/+18
|\ \ | | | | | | Fix off-by-one error in forward reference checking
| * | Fixed #2005: Add test case.Nicolas Stucki2017-02-211-0/+7
| | |
| * | Fix off-by-one error in forward reference checkingMartin Odersky2017-02-183-2/+11
| | |
* | | Merge pull request #1974 from dotty-staging/fix/ctx-captureodersky2017-02-2114-60/+88
|\ \ \ | | | | | | | | 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-182-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-217-11/+28
|\ \ \ \ | | | | | | | | | | Fix #1747: Improve error message for Scala/Java type mismatch
| * | | | Fix test case^2Martin Odersky2017-02-151-2/+2
| | | | |
| * | | | Unrelated cleanup: Make SearchResult sealed.Martin Odersky2017-02-151-1/+1
| | | | |
| * | | | Fix test caseMartin Odersky2017-02-151-1/+1
| | | | |
| * | | | Better error message for Java/Scala method discrepanciesMartin Odersky2017-02-141-2/+14
| | | | |
| * | | | Avoid automatism for passing variances to PolyTypesMartin Odersky2017-02-143-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | We used to "fill-in" with zeroes if variances were missing. I now think that;'s too error-prone. Better define all variances explicitly.
| * | | | Tweak printing of polymrophic methodsMartin Odersky2017-02-142-1/+5
| | | | | | | | | | | | | | | | | | | | Omit the `=>' if a PolyType has a MethodType as result type.
* | | | | Merge pull request #2013 from dotty-staging/fix-#2006Nicolas Stucki2017-02-214-21/+19
|\ \ \ \ \ | | | | | | | | | | | | Don't inline when errors are detected
| * | | | | Don't inline when errors are detectedMartin Odersky2017-02-214-21/+19
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inlining is only well-defined if the body to inline does not have any errors. We therefore check for errors before we perform any transformation of trees related to inlining. The error check is global, i.e. we stop on any error not just on errors in the code to be inlined. This is a safe approximation, of course.
* | | | | Merge pull request #1996 from dotty-staging/fix-#1990odersky2017-02-2113-19/+149
|\ \ \ \ \ | |/ / / / |/| | | | Fix #1990: Handle inlining where this proxies change types
| * | | | Harden outer proxy computation of inlined codeMartin Odersky2017-02-198-30/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that we simply cannot do reliable outer path computation that fills in the right hand sides of this-proxies from the types of these proxies. As-seen-from logic can mangle the types of proxies enough to scramble the necessary information. What we now do instead is simply count: We record the number of outer accesses to an outer this in inlineable code, and do the same number of outer accesses when computing the proxy.
| * | | | Fix sorting of accessed this-proxiesMartin Odersky2017-02-192-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They are sorted according to the nesting depth of the classes they represent. This is no necessarily the same as the nesting level of the symbols of the proxy classes. i1990a.scala shows an example where the two differ.
| * | | | Fix default parameter value.Martin Odersky2017-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Interesting that the tests pass even if we always assume outOfContext = true. So this raises the question why have a flag? It's just that I am not sure the `outOfContext` behavior is correct in all cases. So I prefer to be conservative here.
| * | | | Bonus test: builder patternMartin Odersky2017-02-182-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | This shows that the builder pattern can be expressed with implicit function types.
| * | | | Fix #1990: Handle case where inlining changes class of outerMartin Odersky2017-02-183-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new situation in the test was that outer of the inlined method was `A` but it's as seen from type is a subtype `B`. We need two fixes: - Ignore outerSelects in TreeChecker. These are treated as having fixed symbols. - Adapt the outer-path logic to deal with code that's moved to another context.
* | | | | Merge pull request #2007 from dotty-staging/ennru_MixedLeftAndRightAssocFelix Mulder2017-02-204-10/+67
|\ \ \ \ \ | | | | | | | | | | | | mixed left and right assoc
| * | | | | Use Message ID enumEnno Runne2017-02-202-2/+3
| | | | | |
| * | | | | Incorporated comments from @felixmulderEnno Runne2017-02-202-11/+12
| | | | | |
| * | | | | Change 'mixed left- and right-associative operators' to MessageEnno Runne2017-02-203-8/+63
|/ / / / /
* | | | | Merge pull request #1987 from dotty-staging/topic/remove-unused-flagsFelix Mulder2017-02-208-187/+32
|\ \ \ \ \ | | | | | | | | | | | | Remove unused flags
| * | | | | Make non-existent compiler options emit warnings instead of failingFelix Mulder2017-02-206-15/+16
| | | | | |
| * | | | | Add option to clear sbt log when using `~`Felix Mulder2017-02-201-0/+2
| | | | | |
| * | | | | Remove unused flagsFelix Mulder2017-02-203-173/+15
| |/ / / /
* | | | | Merge pull request #1986 from dotty-staging/error-messages-idsFelix Mulder2017-02-205-56/+116
|\ \ \ \ \ | |_|_|/ / |/| | | | Use enum for error messages IDs.
| * | | | Use enum for error messages IDs.Nicolas Stucki2017-02-165-56/+116
| | | | |
* | | | | Merge pull request #1989 from dotty-staging/remove/scalac-testsGuillaume Martres2017-02-1810-1/+0
|\ \ \ \ \ | |_|_|_|/ |/| | | | Disable tests that require scala-compiler
| * | | | Disable tests that require scala-compilerGuillaume Martres2017-02-1810-1/+0
| | |/ / | |/| | | | | | | | | | This is necessary if we ever want to get rid of our dependency on scala-compiler
* | | | Merge pull request #1972 from dotty-staging/fix/inline-errorsodersky2017-02-182-6/+10
|\ \ \ \ | | | | | | | | | | TreeMap/TreeAccumulator: proper context for inlined trees
| * | | | TreeMap/TreeAccumulator: proper context for inlined treesGuillaume Martres2017-02-132-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was already be done in TreeTraverser but should also be done in TreeMap and TreeAccumulator for ctx.error(..., tree.pos) to not use completely incorrect positions inside inlined trees.