Permalink
Browse files

Test case closes SI-2435.

  • Loading branch information...
retronym committed May 11, 2012
1 parent df10f92 commit e40f3c8790bfa630d0a3e554251f7ada790116da
Showing with 27 additions and 0 deletions.
  1. +27 −0 test/files/pos/t2435.scala
View
@@ -0,0 +1,27 @@
object Bug {
abstract class FChain {
type T
def chain(constant:String) =
new FConstant[this.type](constant, this) //removing [this.type], everything compiles
}
case class FConstant[E <: FChain](constant:String, tail:E) extends FChain {
type T = tail.T
}
object FNil extends FChain {
type T = Unit
}
}
object Test {
import Bug._
println("Compiles:")
val a1 = FNil.chain("a").chain("a")
val a2 = a1.chain("a")
println("\nDoesn't compile:")
val a = FNil.chain("a").chain("a").chain("a")
}

0 comments on commit e40f3c8

Please sign in to comment.