aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Better type inference in harmonizeUnionGuillaume Martres2017-03-184-25/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-184-4/+9
|\ | | | | Reduce type lambdas even if variance changes
| * Reduce type lambdas even if variance changesGuillaume Martres2017-03-162-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * New flag -Ydebug-alias to never follow aliases when printing typesGuillaume Martres2017-03-162-1/+2
| |
* | Merge pull request #2119 from abeln/period-commentDmitry Petrashko2017-03-181-3/+4
|\ \ | | | | | | Update periods-related comments
| * | 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-184-4/+23
|\ \ | | | | | | 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
| | |
| * | Test that #2054 is fixed.Dmitry Petrashko2017-03-071-0/+13
| | |
| * | 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-174-1/+43
| |/ |/| | | | | | | | | | | | | | | 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-164-5/+33
|\ \ | | | | | | 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-164-2/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #2108 from dotty-staging/fix-match-in-mergeCompanionDefsodersky2017-03-161-1/+1
|\ \ \ | | | | | | | | Make pattern match exhaustive for mergeCompanionDefs.
| * | | Remove warning from non exhaustive match in mergeCompanionDefs.Nicolas Stucki2017-03-161-1/+1
|/ / /
* | | Merge pull request #2107 from dotty-staging/disable/sbt-reporterFelix Mulder2017-03-161-1/+1
|\ \ \ | |/ / |/| | sbt-bridge: Fix #2092: Disable position information in the reporter
| * | sbt-bridge: Fix #2092: Disable position information in the reporterGuillaume Martres2017-03-151-1/+1
|/ / | | | | | | | | | | This is temporary until someone figures out how to get sbt to not print duplicated information when this is turned on. This might require changes to sbt itself.
* | Merge pull request #2074 from vlthr/dottydoc-entity-implicitsFelix Mulder2017-03-152-209/+460
|\ \ | | | | | | [WIP] consolidate entity serialization
| * | address feedback on #2074Valthor Halldorsson2017-03-142-123/+346
| | | | | | | | | | | | | | | | | | | | | | | | - Added tests to ensure that the results of serialization match their pre-serialization values. - Removed unused parameter `extras` from Entity.asJava() implicit methods. - Removed _root_ imports - Fixed several code style issues
| * | consolidate entity serialization into single classValthor Halldorsson2017-03-102-166/+194
| | | | | | | | | | | | | | | | | | - refactored JavaEntity to be DRY with respect to repeating the serialization of fields shared by many types of entities - added tests
* | | Merge pull request #2096 from dotty-staging/fix-i2051Dmitry Petrashko2017-03-153-3/+15
|\ \ \ | | | | | | | | 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-142-3/+6
| | | |
* | | | Merge pull request #2043 from dotty-staging/tailrec-derivesFromDmitry Petrashko2017-03-1512-50/+60
|\ \ \ \ | | | | | | | | | | Tailrec for derivesFrom/lookupRefined/classSymbol/classSymbols
| * | | | Add @tailrec to avoid regressions.Nicolas Stucki2017-03-0112-44/+54
| | | | |
| * | | | Make loop in derivesFrom a tailrec loop.Nicolas Stucki2017-03-011-6/+6
| | | | |
* | | | | Merge pull request #2079 from dotty-staging/depmeth2odersky2017-03-1433-142/+242
|\ \ \ \ \ | | | | | | | | | | | | 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
| | | | | |
| * | | | | Test casesMartin Odersky2017-03-142-0/+28
| | | | | |
| * | | | | 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 #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 #2100 from dotty-staging/fix/sbt-reporterGuillaume Martres2017-03-141-9/+27
|\ \ \ \ \ \ | | | | | | | | | | | | | | Various fixes to the sbt reporter
| * | | | | | sbt-bridge: Fix lineContent, pointer, pointerSpaceGuillaume Martres2017-03-141-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These changes were done to imitate how these fields are set in https://github.com/sbt/sbt/blob/0.13/compile/interface/src/main/scala/xsbt/DelegatingReporter.scala The main issue this fixes is sbt displaying the ^ pointer way too far, because the number of spaces was set from the beginning of the file instead of the beginning of the line.
| * | | | | | sbt-bridge: Reduce verbosity by using intermediate variableGuillaume Martres2017-03-141-6/+7
| | | | | | |
| * | | | | | sbt-bridge: simpler way to get file pathGuillaume Martres2017-03-141-4/+5
| | | | | | |
| * | | | | | sbt-bridge: Don't crash when a Message does not have a PositionGuillaume Martres2017-03-141-9/+23
|/ / / / / /