diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-04-16 14:48:25 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-04-16 14:48:25 +1000 |
commit | d2a174d27bce392329a9c5e4c7d2acee263cdb34 (patch) | |
tree | 617a429238d02a13f658d58182a419d17133b398 /test | |
parent | 029cce77bd72cd8255c6dee08a227796cdb158b1 (diff) | |
parent | 4ff3abbe950c0bd703298d7808e1de38894ddac7 (diff) | |
download | scala-d2a174d27bce392329a9c5e4c7d2acee263cdb34.tar.gz scala-d2a174d27bce392329a9c5e4c7d2acee263cdb34.tar.bz2 scala-d2a174d27bce392329a9c5e4c7d2acee263cdb34.zip |
Merge pull request #4449 from retronym/ticket/9273
SI-9273 Avoid unpositioned error for bare classOf
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/t9273.check | 10 | ||||
-rw-r--r-- | test/files/neg/t9273.scala | 9 |
2 files changed, 19 insertions, 0 deletions
diff --git a/test/files/neg/t9273.check b/test/files/neg/t9273.check new file mode 100644 index 0000000000..1dca63a736 --- /dev/null +++ b/test/files/neg/t9273.check @@ -0,0 +1,10 @@ +t9273.scala:2: error: class type required but ? found + val foo: Class[_] = classOf // error without position, line or file + ^ +t9273.scala:3: error: not found: type X + val foo1: Class[_] = classOf[X] // good error, all info contained + ^ +t9273.scala:7: error: not found: type X + val foo4: Class[_] = Predef.classOf[X] // good error, all info contained + ^ +three errors found diff --git a/test/files/neg/t9273.scala b/test/files/neg/t9273.scala new file mode 100644 index 0000000000..3f99dff17f --- /dev/null +++ b/test/files/neg/t9273.scala @@ -0,0 +1,9 @@ +class MissingLineNumbers { + val foo: Class[_] = classOf // error without position, line or file + val foo1: Class[_] = classOf[X] // good error, all info contained + val foo2 = classOf // Infers T=Nothing + + val foo3: Class[_] = Predef.classOf // Infers T=Nothing. Irregular wrt typedIdent. + val foo4: Class[_] = Predef.classOf[X] // good error, all info contained + val foo5 = Predef.classOf // Infers T=Nothing +} |