diff options
author | Paul Phillips <paulp@improving.org> | 2011-01-15 23:21:50 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-01-15 23:21:50 +0000 |
commit | e89b53d7e1f0ec376bd237fbaa8d7a19928e020e (patch) | |
tree | 7f9695a5533cc0c3cd1f828e15b87cb4b1b59707 /test/files | |
parent | 866801385f81417a2ac33916280df918e4bd5b3b (diff) | |
download | scala-e89b53d7e1f0ec376bd237fbaa8d7a19928e020e.tar.gz scala-e89b53d7e1f0ec376bd237fbaa8d7a19928e020e.tar.bz2 scala-e89b53d7e1f0ec376bd237fbaa8d7a19928e020e.zip |
This outlaws explicit isInstanceOf tests on val...
This outlaws explicit isInstanceOf tests on value types, which are
nonsense in any case, as long threatened in ticket #1872. Closes #1872,
review by rytz.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/bug1872.check | 4 | ||||
-rw-r--r-- | test/files/neg/bug1872.scala | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/test/files/neg/bug1872.check b/test/files/neg/bug1872.check new file mode 100644 index 0000000000..9f1af33056 --- /dev/null +++ b/test/files/neg/bug1872.check @@ -0,0 +1,4 @@ +bug1872.scala:3: error: isInstanceOf cannot test if value types are references. + def f(x: Int) = x.isInstanceOf[util.Random] + ^ +one error found diff --git a/test/files/neg/bug1872.scala b/test/files/neg/bug1872.scala new file mode 100644 index 0000000000..0ebee0b32d --- /dev/null +++ b/test/files/neg/bug1872.scala @@ -0,0 +1,4 @@ +class A { + // a true result here would necessitate profound soul searching + def f(x: Int) = x.isInstanceOf[util.Random] +}
\ No newline at end of file |