aboutsummaryrefslogtreecommitdiff
path: root/tests/run/1938-2.scala
Commit message (Collapse)AuthorAgeFilesLines
* Revert <: Product requierment in pattern matchingOlivier Blanvillain2017-04-131-0/+37
The change in question broke the following pattern, commonly used in name based pattern matching: ```scala object ProdEmpty { def _1: Int = ??? def _2: String = ??? def isEmpty = true def get = this } ``` This type define both `_1` and `get` + `isEmpty` (but is not <: Product). After #1938, `ProdEmpty` became eligibles for both product and name based pattern. Because "in case of ambiguities, *Product Pattern* is preferred over *Name Based Pattern*", isEmpty wouldn't be used, breaking the scalac semantics.