How to define a method in Scala that returns a type? - Stack Overflow
You should just put =:
private def createDomNode(tag: String, attrs: Map[String , String]): DomNode = { // ... } If you will not put = between method signature and body, then return type is Unit, so this:
def m(i: Int) {} is the same as
def m(i: Int): Unit = {}Read full article from How to define a method in Scala that returns a type? - Stack Overflow
No comments:
Post a Comment