aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/erased-lub-2.scala
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug in erasedLub leading to incorrect signaturesGuillaume Martres2017-03-081-0/+15
Before this commit, the added testcase failed in a strange way: 14 | def bla(foo: Foo) = orElse2(identity).apply(foo) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |value of type <nonsensical><notype></nonsensical> does not take parameters This happened because the TermRef for the apply method had an incorrect signature, therefore its underlying type was NoType. According to the documentation of `erasedLub`, the erasure should be: "a common superclass or trait S of the argument classes, with the following two properties: S is minimal: no other common superclass or trait derives from S] S is last : in the linearization of the first argument type `tp1` there are no minimal common superclasses or traits that come after S. (the reason to pick last is that we prefer classes over traits that way)." I'm not convinced that the implementation satisfies either of these two properties, but this commit at least makes S closer to being minimal by making sure that the last best candidate never derives from it.