aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/Patterns.scala
Commit message (Collapse)AuthorAgeFilesLines
* Implement new rules for name-based pattern matchingMartin Odersky2016-12-151-0/+28
| | | | This implements the rules laid down in #1805.
* add a test for a pattern match with ignored type paramSarunas Valaskevicius2015-09-251-0/+9
|
* Make sure types of pattern bound variables are fully-defined.Martin Odersky2015-05-021-0/+5
| | | | | | | | | Like all other variables, pattern-bound vars need a fully defined type. I was thinking originally that demanding a fully defined selector type is sufficient to ensure this, but that's not true: An outer pattern might call a polymorphic unapply and its type variables need not be fully instantiated. With the fix, the minimized test case from ExpandSAMs works.
* Rename RefinedThis -> SkolemTypeMartin Odersky2015-01-101-1/+1
| | | | | Also, make binder type of SkolemType refer to arbitrary type, not necessarily RefinedType.
* Reverting the idea that RefinedThis types take levels.Martin Odersky2015-01-101-1/+1
| | | | | | | | | | | | | | | In the end, this did not buy us anything. What matters is that - we can reliably identify RefinedThis types pointing to a given refinement type. Making sure that the `binder` field of q RefinedThis type in a refinedInfo is always the containing refined type is good enough for that. - we take care to rebind RefinedThis types in isSubType. This was leaky before, is handled now better in the new isSubType. So, in the end, adding a level was a needless complication. Also, as a next step we should be able to identify skolem types and RefinedThis types.
* Reorg of subtyping.Martin Odersky2015-01-011-1/+1
| | | | Plus, RefinedThis gets a second parameter, `level`. This will replace the first one in due time.
* Test for patmat action on a @ Bind(_, Typed(_: Unapply, _)Dmitry Petrashko2014-10-141-0/+3
|
* Cleanup patmat based on feedbackDmitry Petrashko2014-10-111-0/+1
| | | | from pr #174.
* Enable outer tests in pattern matcher.Dmitry Petrashko2014-10-111-0/+12
| | | | And a test for this.
* More complicated tests for patmatDmitry Petrashko2014-09-171-12/+30
|
* Several fixes to patmat.Dmitry Petrashko2014-09-171-12/+12
| | | | Now patmat passes tests but erasure fails.
* More complicated patterns.Dmitry Petrashko2014-09-171-0/+24
|
* Split Nullarify functionality to ElimByName, ErasureMartin Odersky2014-08-171-3/+3
| | | | | | | | | | | | | New phase ElimByName elimintaes by-name parameters. All other occurrences of parameterless methods and ExprTypes are eliminated in erasure. The reason for the split like this is that it is very hard for Nullarify to determine when to insert ()'s. The logic for this is fragile because we need to look at previous denotations which might not exist (before splitter) or might result from a merge between parameterless and nullary methods. In Erasure the same is much simpler to achieve.
* Fixed two problems with annotated types in patternsMartin Odersky2014-03-141-3/+9
| | | | | | | | | | Problem 1: The parser did not accept them. It has to accept a "RefinedType" as an ascription, not a "WithType" (as it did before), or even a "SimpleType" (as speced in the SyntaxSummary). Problem 2: Annotations are always typed as expressions. The annotations in question were typed as patterns before. Tests in Patterns.scala and in the Dotty compiler itself.
* Fixes for by-name argumentsMartin Odersky2013-12-171-1/+14
| | | | Previously, we did not strip off the => when comparing against expected type.
* New tests.Martin Odersky2013-11-091-0/+19