| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Reduce type lambdas even if variance changes
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
|\ \
| | |
| | | |
Update periods-related comments
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|\ \
| | |
| | | |
Fix #2054
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | | |
Alternative fix for #2099: avoid loading a private member when recomputing a NamedType denot
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
Make pattern match exhaustive for mergeCompanionDefs.
|
|/ / / |
|
|\ \ \
| |/ /
|/| | |
sbt-bridge: Fix #2092: Disable position information in the reporter
|
|/ /
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | | |
[WIP] consolidate entity serialization
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- 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
|
| | |
| | |
| | |
| | |
| | |
| | | |
- refactored JavaEntity to be DRY with respect to repeating the
serialization of fields shared by many types of entities
- added tests
|
|\ \ \
| | | |
| | | | |
Fix #2051: allow override T with => T or ()T
|
| | | | |
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Tailrec for derivesFrom/lookupRefined/classSymbol/classSymbols
|
| | | | | |
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Allow inter-parameter dependencies
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
All PolyTypes get variances passed, so isTypeLambda is always true
and the deleted assert is never triggered.
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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 account when typechecking arguments.
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Also: check validity of method types, so that no
forward references occur.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
To allow for dependencies between method type parameters, construct MethodTypes
from a closure that maps the currently constructed MethodType to its parameter types.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Fix #1960: add test
|
| | |_|/ / /
| |/| | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Fix #1706: add test
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | | |
The bug is already fixed in PR #1724 while fixing another issue
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Various fixes to the sbt reporter
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
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.
|
| | | | | | | |
|
| | | | | | | |
|
|/ / / / / / |
|