diff options
author | Paul Phillips <paulp@improving.org> | 2012-10-31 07:09:01 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-10-31 07:09:01 -0700 |
commit | 8aec78470637f42f50981f8034215a709602dbad (patch) | |
tree | c27ce7457fdda7514a1bf05cb27551a72b0ec1d4 /test/files/pos | |
parent | 34d021ad2021d3dbedc8b6fe20f7f0f6d1569757 (diff) | |
parent | ae0171321b94c42a36d0987503450ce2657fd516 (diff) | |
download | scala-8aec78470637f42f50981f8034215a709602dbad.tar.gz scala-8aec78470637f42f50981f8034215a709602dbad.tar.bz2 scala-8aec78470637f42f50981f8034215a709602dbad.zip |
Merge remote-tracking branch 'origin/2.10.0-wip' into merge-2.10.0-wip
# By Jason Zaugg (5) and others
# Via Josh Suereth (5) and others
* origin/2.10.0-wip:
Use Typed rather than .setType
Wider use and a new variant of typedPos.
SI-6575 Plug inference leak of AbstractPartialFun
Disabled generation of _1, _2, etc. methods.
SI-6526 Additional test case.
Fix SI-6552, regression with self types.
avoid single-art assert where harmful in duration-tck
Fix for SI-6537, inaccurate unchecked warning.
SI-6526 Tail call elimination should descend deeper.
Changes Tree and Type members from vals to defs.
Fixes SI-6170: issue with dragging scaladoc splitter over central iframe
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/t6537.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t6537.scala | 16 | ||||
-rw-r--r-- | test/files/pos/t6552.scala | 8 | ||||
-rw-r--r-- | test/files/pos/t6575a.scala | 15 | ||||
-rw-r--r-- | test/files/pos/t6575b.scala | 17 |
5 files changed, 57 insertions, 0 deletions
diff --git a/test/files/pos/t6537.flags b/test/files/pos/t6537.flags new file mode 100644 index 0000000000..85d8eb2ba2 --- /dev/null +++ b/test/files/pos/t6537.flags @@ -0,0 +1 @@ +-Xfatal-warnings diff --git a/test/files/pos/t6537.scala b/test/files/pos/t6537.scala new file mode 100644 index 0000000000..d0ca3ba435 --- /dev/null +++ b/test/files/pos/t6537.scala @@ -0,0 +1,16 @@ +package tester + +object PatMatWarning { + + sealed trait X + sealed trait Y + + def f(x: X) = x match { + case _: Y => false + case _ => true + } + + class X1 extends X + class Y1 extends Y + class Z1 extends X with Y +} diff --git a/test/files/pos/t6552.scala b/test/files/pos/t6552.scala new file mode 100644 index 0000000000..98e686a1ae --- /dev/null +++ b/test/files/pos/t6552.scala @@ -0,0 +1,8 @@ +object Repros { + class Bar {} + class Baz(val myFoo: Foo) { } + trait Foo { + this: Bar => + val thing = new Baz(this) + } +} diff --git a/test/files/pos/t6575a.scala b/test/files/pos/t6575a.scala new file mode 100644 index 0000000000..f128714dab --- /dev/null +++ b/test/files/pos/t6575a.scala @@ -0,0 +1,15 @@ +trait X { def foo: PartialFunction[Int, Int] } + +trait Y extends X { + // Inferred type was AbstractPartialFunction[Int, Int] with Serializable + abstract override def foo = { case i => super.foo(i) * 2 } +} +trait Z extends X { + // ditto + abstract override def foo = { case i => super.foo(i) + 3 } +} + +trait Comb extends Y with Z { + // ... which led to a type error here. + abstract override def foo: PartialFunction[Int, Int] = { case i => super.foo(i) - 2 } +} diff --git a/test/files/pos/t6575b.scala b/test/files/pos/t6575b.scala new file mode 100644 index 0000000000..d3e58b2a16 --- /dev/null +++ b/test/files/pos/t6575b.scala @@ -0,0 +1,17 @@ +// inferred types were okay here as Function nodes aren't +// translated into anoymous subclasses of AbstractFunctionN +// until after the typer. +// +// So this test is just confirmation. +trait X { def foo: Function1[Int, Int] } + +trait Y extends X { + abstract override def foo = { case i => super.foo(i) * 2 } +} +trait Z extends X { + abstract override def foo = { case i => super.foo(i) + 3 } +} + +trait Comb extends Y with Z { + abstract override def foo: Function1[Int, Int] = { case i => super.foo(i) - 2 } +} |