aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/CrossCastAnd.scala
Commit message (Collapse)AuthorAgeFilesLines
* CrossCastAnd: reimplement it in more compact way.Dmitry Petrashko2015-11-101-23/+5
| | | | | | | | | | | | | | | | | | | | | | 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.
* CrossCastAnd: Fix issue with Phases.Dmitry Petrashko2015-11-101-1/+1
| | | | | Right part of and type should not be widened, as dotty could have used non-widened type to drive type inference.
* New phase: crossCastAnd.Dmitry Petrashko2015-11-101-0/+48
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`