diff options
author | Paolo G. Giarrusso <p.giarrusso@gmail.com> | 2013-01-21 23:43:03 +0100 |
---|---|---|
committer | Paolo G. Giarrusso <p.giarrusso@gmail.com> | 2013-03-15 01:32:47 +0100 |
commit | 4bb8988e0263206fc914537c7762b0ee3b9057aa (patch) | |
tree | 862e6067aa76d6e87a9e683d550b74b817b6349a /test/files/neg/abstract-explaintypes.scala | |
parent | ec6548fb91309b72bd46ff939f79bb253ca5953a (diff) | |
download | scala-4bb8988e0263206fc914537c7762b0ee3b9057aa.tar.gz scala-4bb8988e0263206fc914537c7762b0ee3b9057aa.tar.bz2 scala-4bb8988e0263206fc914537c7762b0ee3b9057aa.zip |
Add positive and negative testcases for SI-6123 (-explaintypes)
Positive testcases compile reduced known offenders to verify that no output is
produced.
The negative testcase tests that -explaintypes actually produces output on code which fails
to compile. I have altered an existing testcase, `test/files/neg/abstract`,
adding -explaintypes to the flags.
This testcase is currently mostly ineffective, as partest currently ignores the
standard output (SI-7003). It will become more effective when SI-7003 is fixed.
But already now, testers would at least be able to notice extraneous output.
This argument is somewhat bogus, but this patch is no worse than the other ones
which are committed while SI-7003 is open.
Diffstat (limited to 'test/files/neg/abstract-explaintypes.scala')
-rw-r--r-- | test/files/neg/abstract-explaintypes.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/neg/abstract-explaintypes.scala b/test/files/neg/abstract-explaintypes.scala new file mode 100644 index 0000000000..f8ecae16fa --- /dev/null +++ b/test/files/neg/abstract-explaintypes.scala @@ -0,0 +1,11 @@ +trait A { + type T <: A; + def baz(): A; + def bar(): T; + def foo1: A = bar().bar(); + def foo2: T = bar().baz(); + def foo3 = bar().baz(); + def foo4: A = baz().bar(); + def foo5: T = baz().baz(); + def foo6 = baz().baz(); +} |