diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-07-27 22:24:51 -0700 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-07-27 22:24:51 -0700 |
commit | 0b7dddbf88f582c9e04105407509334fb1ee50ec (patch) | |
tree | 095b82a4ea91c73810b06650eceed0b82f1981e0 /test | |
parent | 6717d6d91af4d2e24e5c3884ddf3204dc078285e (diff) | |
parent | c4bf1d5fb5a4d5e64e64b6af985fc795faa15bce (diff) | |
download | scala-0b7dddbf88f582c9e04105407509334fb1ee50ec.tar.gz scala-0b7dddbf88f582c9e04105407509334fb1ee50ec.tar.bz2 scala-0b7dddbf88f582c9e04105407509334fb1ee50ec.zip |
Merge pull request #2738 from retronym/ticket/7636
SI-7636 Fix a NPE in typing class constructors
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/t7636-neg.check | 10 | ||||
-rw-r--r-- | test/files/neg/t7636.scala | 7 |
2 files changed, 17 insertions, 0 deletions
diff --git a/test/files/neg/t7636-neg.check b/test/files/neg/t7636-neg.check new file mode 100644 index 0000000000..f70d50bee3 --- /dev/null +++ b/test/files/neg/t7636-neg.check @@ -0,0 +1,10 @@ +t7636.scala:3: error: illegal inheritance; + self-type Main.C does not conform to Main.ResultTable[_$3]'s selftype Main.ResultTable[_$3] + class C extends ResultTable(Left(5):Either[_,_])(5) + ^ +t7636.scala:3: error: type mismatch; + found : Either[_$2,_$3(in constructor C)] where type _$3(in constructor C), type _$2 + required: Either[_, _$3(in object Main)] where type _$3(in object Main) + class C extends ResultTable(Left(5):Either[_,_])(5) + ^ +two errors found diff --git a/test/files/neg/t7636.scala b/test/files/neg/t7636.scala new file mode 100644 index 0000000000..a7b1b90151 --- /dev/null +++ b/test/files/neg/t7636.scala @@ -0,0 +1,7 @@ +object Main extends App{ + class ResultTable[E]( query : Either[_,E] )( columns : Int ) + class C extends ResultTable(Left(5):Either[_,_])(5) +} +// Inference of the existential type for the parent type argument +// E still fails. That looks tricky to fix, see the comments in SI-7636. +// But we at least prevent a cascading NPE.
\ No newline at end of file |