| 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Drop the [type T] syntax, and what's associated to make it work.
Motivation: It's an alternative way of doing things for which there seems
to be little need. The implementation was provisional and bitrotted during
the various iterations to introduce higher-kinded types. So in the end the
complxity-cost for language and compiler was not worth the added benefit
that [type T] parameters provide.
Noe that we still accept _named arguments_ [A = T] in expressions; these are useful
for specifying some parameters and letting others be inferred.
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Make more parts of stdlib compile
|
| |
| |
| |
| | |
Avoids potentially expensive string assembly operations.
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
| |
Typer#ensureReported's comment outlines an example where errors
could go unreported, resulting in error trees after typer without
any reported error messages. This commit makes sure that at least
one error is reported if a tree node has an error type.
Fixes #1802.
|
|
|
|
|
|
| |
i1751.scala shows a case where we need to compute the approximation
of an or-type during erasure. This can lead to an empty set of common
classes because Any does not exist anymore after erasure.
|
|
|