diff options
author | Paul Phillips <paulp@improving.org> | 2012-02-23 10:59:55 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-02-23 11:06:14 -0800 |
commit | 622656dfc87100bc94a37f3b244955c96d526023 (patch) | |
tree | 1832c7de4759defc03266e32c33b887554a69647 /test/files/pos | |
parent | 119c9554cf948163433ab12ce8cdd36814f63e4a (diff) | |
download | scala-622656dfc87100bc94a37f3b244955c96d526023.tar.gz scala-622656dfc87100bc94a37f3b244955c96d526023.tar.bz2 scala-622656dfc87100bc94a37f3b244955c96d526023.zip |
Moved and edited tests.
Remove obsolete, move passing pending -> files, update
those-kinds-are-high with some new info, added a couple
new ones to pending.
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/local-objects.scala | 9 | ||||
-rw-r--r-- | test/files/pos/package-case.scala | 4 | ||||
-rw-r--r-- | test/files/pos/t1957.scala | 38 | ||||
-rw-r--r-- | test/files/pos/t1987b/a.scala | 7 | ||||
-rw-r--r-- | test/files/pos/t1987b/b.scala | 10 | ||||
-rw-r--r-- | test/files/pos/t2194.scala | 8 |
6 files changed, 76 insertions, 0 deletions
diff --git a/test/files/pos/local-objects.scala b/test/files/pos/local-objects.scala new file mode 100644 index 0000000000..ed7c50ead9 --- /dev/null +++ b/test/files/pos/local-objects.scala @@ -0,0 +1,9 @@ + + +object Main { + val x = { + object Boo + Boo + } +} + diff --git a/test/files/pos/package-case.scala b/test/files/pos/package-case.scala new file mode 100644 index 0000000000..906f1eb3f2 --- /dev/null +++ b/test/files/pos/package-case.scala @@ -0,0 +1,4 @@ +// a.scala +// Sat Jul 16 00:34:36 EDT 2011 + +package object io { case class TextReader() } diff --git a/test/files/pos/t1957.scala b/test/files/pos/t1957.scala new file mode 100644 index 0000000000..f80cf730ed --- /dev/null +++ b/test/files/pos/t1957.scala @@ -0,0 +1,38 @@ +object Test { + abstract class Settings {} + + abstract class Grist + { self => + type settingsType <: Settings + type moduleType <: Module {type settingsType = self.settingsType} + val module: moduleType + } + + abstract class Tool + { self => + type settingsType <: Settings + type moduleType = Module { type settingsType = self.settingsType } + type gristType = Grist { type moduleType <: self.moduleType; type settingsType <: self.settingsType } + + def inputGrist: List[gristType] + } + + abstract class Module + { self => + type settingsType <: Settings + final type commonModuleType = Module {type settingsType = self.settingsType} + type selfType >: self.type <: commonModuleType + + // BTW: if we use the commented out type declarations, the code compiles successfully + // type gristType = Grist {type settingsType <: self.settingsType; type moduleType <: commonModuleType } + + val tools: List[Tool {type settingsType = self.settingsType}] + + protected def f: List[commonModuleType] = + { + val inputGrists = tools.flatMap(_.inputGrist) // val inputGrists: List[gristType] = + inputGrists.map(_.module) + } + + } +} diff --git a/test/files/pos/t1987b/a.scala b/test/files/pos/t1987b/a.scala new file mode 100644 index 0000000000..ff27044b69 --- /dev/null +++ b/test/files/pos/t1987b/a.scala @@ -0,0 +1,7 @@ +package bug + +// goes with t1987b.scala +package object packageb { + def func(a: Int) = () + def func(a: String) = () +} diff --git a/test/files/pos/t1987b/b.scala b/test/files/pos/t1987b/b.scala new file mode 100644 index 0000000000..a469ca6ea8 --- /dev/null +++ b/test/files/pos/t1987b/b.scala @@ -0,0 +1,10 @@ +// compile with t1987a.scala + +package bug.packageb +// Note that the overloading works if instead of being in the package we import it: +// replace the above line with import bug.packageb._ + +class Client { + val x = func(1) // doesn't compile: type mismatch; found: Int(1) required: String + val y = func("1") // compiles +} diff --git a/test/files/pos/t2194.scala b/test/files/pos/t2194.scala new file mode 100644 index 0000000000..e87be509d1 --- /dev/null +++ b/test/files/pos/t2194.scala @@ -0,0 +1,8 @@ +// tricky to do differently? +class C + +object Test { + def f = { object o extends C; o} + val y: C = f + val x = f +} |