diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-03-14 11:47:59 +0100 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-03-20 19:54:03 +0100 |
commit | b046a6e3316df8b27ac31e71da1a139c800ccce7 (patch) | |
tree | dfbed2ea5620d100a62bbdf39b93488628e8cbb3 /test/pending | |
parent | 2d3b309a36757545901b99da1b77698749fcc0c5 (diff) | |
download | scala-b046a6e3316df8b27ac31e71da1a139c800ccce7.tar.gz scala-b046a6e3316df8b27ac31e71da1a139c800ccce7.tar.bz2 scala-b046a6e3316df8b27ac31e71da1a139c800ccce7.zip |
[vpm] typer synths Function{} for empty-sel match
typedMatchAnonFun is called from typedFunction when the function's body is a match
this is work-in-progres: the compiler currently won't bootstrap under -Yvirtpatmat
see also the pending test
make sure to use the right context in typeFunction when the body is a Match
when typer is set up for type checking a Function, the current owner is the symbol for the function,
but we'll type check a Block(List(ClassDef(cd)), New(cd)) when the function is a match,
and the function symbol is nowhere to be found, so go to outer context
in patmatvirt:
- simplified default case gen (no need for a Casegen instance)
- using CASE | SYNTHETIC to detect generated matches (for switches) and avoid typing them endlessly
more uniform, and necessary for new-style anon Function class instance gen for matches
Diffstat (limited to 'test/pending')
-rw-r--r-- | test/pending/run/virtpatmat_anonfun_underscore.check | 0 | ||||
-rw-r--r-- | test/pending/run/virtpatmat_anonfun_underscore.flags | 1 | ||||
-rw-r--r-- | test/pending/run/virtpatmat_anonfun_underscore.scala | 4 |
3 files changed, 5 insertions, 0 deletions
diff --git a/test/pending/run/virtpatmat_anonfun_underscore.check b/test/pending/run/virtpatmat_anonfun_underscore.check new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/pending/run/virtpatmat_anonfun_underscore.check diff --git a/test/pending/run/virtpatmat_anonfun_underscore.flags b/test/pending/run/virtpatmat_anonfun_underscore.flags new file mode 100644 index 0000000000..23e3dc7d26 --- /dev/null +++ b/test/pending/run/virtpatmat_anonfun_underscore.flags @@ -0,0 +1 @@ +-Yvirtpatmat
\ No newline at end of file diff --git a/test/pending/run/virtpatmat_anonfun_underscore.scala b/test/pending/run/virtpatmat_anonfun_underscore.scala new file mode 100644 index 0000000000..db6705d025 --- /dev/null +++ b/test/pending/run/virtpatmat_anonfun_underscore.scala @@ -0,0 +1,4 @@ +object Test extends App { + List(1,2,3) map (_ match { case x => x + 1} ) // `_ match` is redundant but shouldn't crash the compiler + List((1,2)) map (_ match { case (x, z) => x + z}) +}
\ No newline at end of file |