aboutsummaryrefslogtreecommitdiff
path: root/compiler/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Update periods-related commentsAbel Nieto2017-03-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The phase width in a period was bumped from 6 to 7 in https://github.com/lampepfl/dotty/commit/16671a00371df2bdbaf6ae7f51b0ec7191ce94f3 but the comment wasn't updated. Update the comment (and another unrelated comment). Tested: No
* | | Merge pull request #2058 from dotty-staging/fix-2054liu fengyun2017-03-183-4/+10
|\ \ \ | |_|/ |/| | Fix #2054
| * | fix typo in commentliu fengyun2017-03-181-1/+1
| | |
| * | Fix a stupid error in fix of #2054.Dmitry Petrashko2017-03-132-4/+7
| | |
| * | Fix #2054: @Static methods may access synthetic private methods stuffDmitry Petrashko2017-03-072-2/+5
| | | | | | | | | | | | | | | | | | Due to way how we desugar lambdas, we can decide to make a lambda static Static methods could refer to those lambdas and we need to make them public
* | | Move 'invalid super qualifier' error to new error format.Abel Nieto2017-03-173-1/+19
| |/ |/| | | | | | | | | | | | | | | As part of https://github.com/lampepfl/dotty/issues/1589, use the new error message for static super references where the qualifier isn't a parent of the class. Tested: Added unit test.
* | Merge pull request #2106 from dotty-staging/fix/param-forwarder-access-take-2odersky2017-03-161-5/+5
|\ \ | | | | | | Alternative fix for #2099: avoid loading a private member when recomputing a NamedType denot
| * | Allow going from non-priv to priv denot when run changesGuillaume Martres2017-03-161-11/+6
| | |
| * | Don't force denotations in asMemberOfGuillaume Martres2017-03-161-5/+6
| | | | | | | | | | | | | | | | | | This was introduced in the previous commit and caused unpickling failures, we are now more conservative and only check the Private flag on SymDenotations so we don't have to load any other denotation.
| * | Fix #2099: avoid loading a private member when recomputing a NamedType denotGuillaume Martres2017-03-161-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Remove warning from non exhaustive match in mergeCompanionDefs.Nicolas Stucki2017-03-161-1/+1
|/ /
* | Merge pull request #2096 from dotty-staging/fix-i2051Dmitry Petrashko2017-03-151-3/+4
|\ \ | | | | | | Fix #2051: allow override T with => T or ()T
| * | fix #2051: allow override T with => T or ()Tliu fengyun2017-03-141-3/+4
| | |
* | | Merge pull request #2043 from dotty-staging/tailrec-derivesFromDmitry Petrashko2017-03-1511-48/+58
|\ \ \ | | | | | | | | Tailrec for derivesFrom/lookupRefined/classSymbol/classSymbols
| * | | Add @tailrec to avoid regressions.Nicolas Stucki2017-03-0111-42/+52
| | | |
| * | | Make loop in derivesFrom a tailrec loop.Nicolas Stucki2017-03-011-6/+6
| | | |
* | | | Merge pull request #2079 from dotty-staging/depmeth2odersky2017-03-1431-142/+214
|\ \ \ \ | | | | | | | | | | Allow inter-parameter dependencies
| * | | | Drop dead method and testMartin Odersky2017-03-141-19/+2
| | | | | | | | | | | | | | | | | | | | | | | | | All PolyTypes get variances passed, so isTypeLambda is always true and the deleted assert is never triggered.
| * | | | Fix unrelated typos in commentsMartin Odersky2017-03-142-7/+7
| | | | |
| * | | | Check there are no forward dependencies to method parametersMartin Odersky2017-03-142-1/+20
| | | | |
| * | | | Fix unpickling of param-dependent methodsMartin Odersky2017-03-141-2/+2
| | | | |
| * | | | Drop mixed MethodType apply methodMartin Odersky2017-03-145-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dropped method takes direct parameter types but a result type expression. Since parameter types are now in general dependent as well, that method is mostly redundant.
| * | | | Take parameter dependencies into accountMartin Odersky2017-03-142-5/+27
| | | | | | | | | | | | | | | | | | | | Take parameter dependencies into account when typechecking arguments.
| * | | | Add method to track parameter dependency statusMartin Odersky2017-03-141-4/+24
| | | | |
| * | | | Construct dependent method types from symbolsMartin Odersky2017-03-142-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | Also: check validity of method types, so that no forward references occur.
| * | | | Construct MethodTypes from parameter closureMartin Odersky2017-03-1425-96/+108
| | | | | | | | | | | | | | | | | | | | | | | | | To allow for dependencies between method type parameters, construct MethodTypes from a closure that maps the currently constructed MethodType to its parameter types.
* | | | | Merge pull request #2091 from dotty-staging/fix-#2077Guillaume Martres2017-03-142-11/+10
|\ \ \ \ \ | |/ / / / |/| | | | Fix #2077: Optimization of constant conditionals
| * | | | Fix #2077: Optimization of constant conditionalsMartin Odersky2017-03-132-11/+10
| | |/ / | |/| | | | | | | | | | | | | | Move fixed logic to FirstTransform, where the other constant folding operations are also done.
* | | | Merge pull request #2090 from dotty-staging/fix/ParSetLikeodersky2017-03-141-0/+7
|\ \ \ \ | | | | | | | | | | Fix #2089: Error when compiling ParSetLike, ParSet, SetLike, in this order
| * | | | Fix #2089: Error when compiling ParSetLike, ParSet, SetLike, in this orderGuillaume Martres2017-03-131-0/+7
| |/ / / | | | | | | | | | | | | | | | | This fix is inspired by 6c91684, but I couldn't tell you why it works exactly, it's just something I tried.
* | | | Merge pull request #2093 from dotty-staging/fix/sourceFileodersky2017-03-141-4/+7
|\ \ \ \ | | | | | | | | | | Fix Symbol#sourceFile not working after Flatten
| * | | | Fix Symbol#sourceFile not working after FlattenGuillaume Martres2017-03-141-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | The SourceFile annotation is only present on the non-flattened top-level class.
* | | | | Merge pull request #2094 from dotty-staging/fix-i2071odersky2017-03-141-0/+2
|\ \ \ \ \ | | | | | | | | | | | | Fix #2071: handle HKApply in SAMType
| * | | | | fix #2071: handle HKApply in SAMTypeliu fengyun2017-03-141-0/+2
| | |/ / / | |/| | |
* / | | | fix #1488: unfriendly jumping in evaluating lazy val blockliu fengyun2017-03-141-1/+1
|/ / / /
* / / / Fix compilation of ParSetLike by itselfGuillaume Martres2017-03-131-3/+3
|/ / / | | | | | | | | | | | | | | | | | | Before this commit, ParSetLike compiled fine as part of compileStdLib but crashed when compiled by itself because we tried to force a LazyRef while forcing the same LazyRef. This commit fixes this by being slightly more lazy where it matters.
* | | Merge pull request #2080 from dotty-staging/fix#-2066odersky2017-03-125-16/+30
|\ \ \ | | | | | | | | Fix #2066: Don't qualify private members in SelectionProto's...
| * | | Alternative fix of #2066.Martin Odersky2017-03-123-16/+24
| | | | | | | | | | | | | | | | | | | | 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-123-3/+9
| | | | | | | | | | | | | | | | ... unless they would be accessible in the given context.
* | | | -Yplain-printer: do not print positions by defaultGuillaume Martres2017-03-121-1/+1
| | | | | | | | | | | | | | | | You can still have positions printed by explictly passing -Yprintpos
* | | | Merge pull request #2078 from dotty-staging/fix-#1569-v2Guillaume Martres2017-03-123-17/+29
|\ \ \ \ | | | | | | | | | | Fix #360: Improve avoidance algorithm
| * | | | Comment ApproximatingTypeMapMartin Odersky2017-03-121-0/+7
| | | | |
| * | | | Improve definition and doc comment for ensureNoLeaksMartin Odersky2017-03-122-23/+22
| | | | | | | | | | | | | | | | | | | | No more try-again business necessary.
| * | | | Fix #1569: Improve avoidance algorithmMartin Odersky2017-03-121-4/+10
| |/ / / | | | | | | | | | | | | | | | | | | | | The essential change is that we do not throw away more precise info of the avoided type if the expected type is fully defined.
* | | | ElimRepeated: Do not use installAfterGuillaume Martres2017-03-121-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a mistake introduced in the previous commit, installAfter is only safe to use in `IdentityDenotTransformer` phases, otherwise it means that the phase denotation transformer is not run at all for this particular denotation, this caused Ycheck to fail.
* | | | Fix overriding a Java method with varargsGuillaume Martres2017-03-123-4/+12
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #2070 from dotty-staging/fix/erasedLubodersky2017-03-091-4/+8
|\ \ \ | | | | | | | | Fix bug in erasedLub leading to incorrect signatures
| * | | Fix bug in erasedLub leading to incorrect signaturesGuillaume Martres2017-03-081-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-8/+7
|\ \ \ \ | | | | | | | | | | Fix #2064: Avoid illegal types in OrDominator
| * | | | Fix commentMartin Odersky2017-03-081-2/+3
| | | | |