diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2015-03-24 12:27:05 +0100 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@typesafe.com> | 2015-03-24 12:27:05 +0100 |
commit | 4783a25d3068c2f756b8517b69a95b5d77d24654 (patch) | |
tree | 299eff9687e4b26885a9b4ea655979b7a699dcf4 /test | |
parent | a280ce61fbff0f1e8e3f1c3179833db9927ff0e3 (diff) | |
parent | 3d9d1f6c99d2ee803402b02cccba72086af74b38 (diff) | |
download | scala-4783a25d3068c2f756b8517b69a95b5d77d24654.tar.gz scala-4783a25d3068c2f756b8517b69a95b5d77d24654.tar.bz2 scala-4783a25d3068c2f756b8517b69a95b5d77d24654.zip |
Merge pull request #4396 from retronym/ticket/9074-2.12
SI-9074 Fix generic substitution with package objects, overloading
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t9074.scala | 24 | ||||
-rw-r--r-- | test/files/pos/t9074b.scala | 15 |
2 files changed, 39 insertions, 0 deletions
diff --git a/test/files/pos/t9074.scala b/test/files/pos/t9074.scala new file mode 100644 index 0000000000..67db281f54 --- /dev/null +++ b/test/files/pos/t9074.scala @@ -0,0 +1,24 @@ +package blam { + + package foo { + + trait F[T] { + def f(d: Double, t: T): T = ??? + def f(d: Int, t: T): T = ??? + def f(d: String, t: T): T = ??? + + def g[A](a: T): T = ??? + def g(a: Int) = ??? + } + } + + package object foo extends foo.F[Double] { + override def f(d: Double, t: Double): Double = ??? + } +} + +object Test { + import blam._ + foo.f("3", 4.0) + foo.g[Any](1d) : Double +} diff --git a/test/files/pos/t9074b.scala b/test/files/pos/t9074b.scala new file mode 100644 index 0000000000..dadcebf399 --- /dev/null +++ b/test/files/pos/t9074b.scala @@ -0,0 +1,15 @@ +trait Echo [T] { + def echo(t: T): Unit +} + +trait IntEcho extends Echo[Int] { + def echo(t: Int) = println(t) +} + +object echo extends IntEcho +package object echo1 extends IntEcho + +object App extends App { + echo.echo(1) + echo1.echo(1) +} |