diff options
author | Martin Odersky <odersky@gmail.com> | 2014-05-16 13:58:25 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-05-30 14:38:30 +0200 |
commit | 772d57cd0874d992b3d5bad12e8f30746b24f5d6 (patch) | |
tree | 3273b5e6e3f757d9b49a5e3d209455743ec04d25 /tests | |
parent | 20034dd5500815ff04052cbc9a97deddacb3e892 (diff) | |
download | dotty-772d57cd0874d992b3d5bad12e8f30746b24f5d6.tar.gz dotty-772d57cd0874d992b3d5bad12e8f30746b24f5d6.tar.bz2 dotty-772d57cd0874d992b3d5bad12e8f30746b24f5d6.zip |
typedTyped needs to maintain Mode.
The first part of a type ascription e: T can be a pattern or an expression. The mode
has to be kept depending on what it was on the outside.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/new/t2660.scala | 25 | ||||
-rw-r--r-- | tests/pending/pos/tuplePatDef.scala | 4 |
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/new/t2660.scala b/tests/new/t2660.scala new file mode 100644 index 000000000..94a40f740 --- /dev/null +++ b/tests/new/t2660.scala @@ -0,0 +1,25 @@ +package hoho + +class G + +class H extends G + +class A[T](x: T) { + + def this(y: G, z: T) = { + this(z) + print(1) + } + + def this(z: H, h: T) = { + this(h) + print(2) + } +} + +object T { + def main(args: Array[String]): Unit = { + implicit def g2h(g: G): H = new H + new A[Int](new H, 23) + } +} diff --git a/tests/pending/pos/tuplePatDef.scala b/tests/pending/pos/tuplePatDef.scala new file mode 100644 index 000000000..978052991 --- /dev/null +++ b/tests/pending/pos/tuplePatDef.scala @@ -0,0 +1,4 @@ + +object Test { + val (x,y): (String, M) = null +} |