diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-04-21 22:34:41 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-04-21 22:34:41 +0200 |
commit | 07fe50311890f4853f7155a5c1a559ac58106134 (patch) | |
tree | de3188e9f7b4c4f611d65fba9235e418976136ce /test | |
parent | 178e9abe7b2481c010496f2d15f389fef0320e0a (diff) | |
parent | b7f359c718717262fa447f428dbd600ddd3b29bd (diff) | |
download | scala-07fe50311890f4853f7155a5c1a559ac58106134.tar.gz scala-07fe50311890f4853f7155a5c1a559ac58106134.tar.bz2 scala-07fe50311890f4853f7155a5c1a559ac58106134.zip |
Merge pull request #3635 from retronym/ticket/8329
SI-8329 Better hygiene for patmat partial functions
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t8329.scala | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/files/pos/t8329.scala b/test/files/pos/t8329.scala new file mode 100644 index 0000000000..fcd5e50b37 --- /dev/null +++ b/test/files/pos/t8329.scala @@ -0,0 +1,29 @@ +object Test { + def pf(pf: PartialFunction[Any, Unit]) = () + def f1(pf: Function[Any, Unit]) = () + + class A1; class B1 + def test1(x: String, x1: String, default: String) = pf { + case _ if ( + x.isEmpty + && default.isEmpty // was binding to synthetic param + && x1.isEmpty // was binding to synthetic param + ) => + x.isEmpty + default.isEmpty // was binding to synthetic param + x1.isEmpty // was binding to synthetic param + new A1; new B1 + } + + def test2(x: String, x1: String, default: String) = f1 { + case _ if ( + x.isEmpty + && default.isEmpty + && x1.isEmpty + ) => + x.isEmpty + default.isEmpty + x1.isEmpty + new A1; new B1 + } +} |