| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Note that there is a slight difference in behaviour:
it will be unconditionally adding cast even if its not needed.
For example in callsFoo1 cast is not needed(erasure will insert a correct one).
```
class A{
private def foo = 1
def callsFoo1(other: A & B): Int = other.foo
def callsFoo2(other: B & A): Int = other.foo
}
trait B {
def foo(i: Int) = i
}
```
Though as AndTypes are uncommon I do not expect this to have
non-negligible impact on performance.
|
|
|
|
|
| |
Right part of and type should not be widened,
as dotty could have used non-widened type to drive type inference.
|
|
This transform makes sure that all private member selections from
AndTypes are performed from the first component of AndType.
This is needed for correctness of erasure.
See `tests/run/PrivateAnd.scala`
|