scalacenter / scala

The Scala programming language

Home Page:http://www.scala-lang.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support nullary method refinements

bishabosha opened this issue · comments

e.g.

trait Methodic {
  def nullary: Any
}

class Blip[A, M <: Methodic { def nullary: A } ] {
  def blip(m: M): A = m.nullary
}

class MethodicInt extends Methodic {
  def nullary: Int = 23
}

object Test {
  val test = new Blip[Int, MethodicInt]
}

closed by #58