diff options
author | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2007-07-27 12:31:09 +0000 |
---|---|---|
committer | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2007-07-27 12:31:09 +0000 |
commit | d3f33a44f8644b757d378fc9e13f7035ced874b0 (patch) | |
tree | d5c2d018ac17b66251b7cf208878acd16366c684 /test/files/neg/structural.check | |
parent | 9f95026c8e4956e6e154f7b7e2bfa6903cc37bc7 (diff) | |
download | scala-d3f33a44f8644b757d378fc9e13f7035ced874b0.tar.gz scala-d3f33a44f8644b757d378fc9e13f7035ced874b0.tar.bz2 scala-d3f33a44f8644b757d378fc9e13f7035ced874b0.zip |
Added test for structural refinement error cases.
Diffstat (limited to 'test/files/neg/structural.check')
-rw-r--r-- | test/files/neg/structural.check | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/files/neg/structural.check b/test/files/neg/structural.check new file mode 100644 index 0000000000..a0342c4d9c --- /dev/null +++ b/test/files/neg/structural.check @@ -0,0 +1,19 @@ +structural.scala:3: error: illegal dependent method type + def f(x: { type D; def m: D }) = x.m + ^ +structural.scala:10: error: Parameter type in structural refinement may not refer to abstract type defined outside that same refinement + def f1[C <: AnyRef](x: AnyRef{ type D <: AnyRef; def m[E >: Null <: AnyRef](x: A): AnyRef; val x: A }) = x.m[Tata](x.x) //fail + ^ +structural.scala:11: error: Parameter type in structural refinement may not refer to abstract type defined outside that same refinement + def f2[C <: AnyRef](x: AnyRef{ type D <: AnyRef; def m[E >: Null <: AnyRef](x: B): AnyRef; val x: B }) = x.m[Tata](x.x) //fail + ^ +structural.scala:12: error: Parameter type in structural refinement may not refer to abstract type defined outside that same refinement + def f3[C <: AnyRef](x: AnyRef{ type D <: AnyRef; def m[E >: Null <: AnyRef](x: C): AnyRef; val x: C }) = x.m[Tata](x.x) //fail + ^ +structural.scala:19: error: illegal dependent method type + def f9[C <: AnyRef](x: AnyRef{ type D <: AnyRef; def m[E >: Null <: AnyRef](x: AnyRef): D }) = x.m[Tata](()) //suceed + ^ +structural.scala:42: error: Parameter type in structural refinement may not refer to abstract type defined outside that same refinement + type Summable[T] = { def +(v : T) : T } + ^ +6 errors found |