KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm experiencing an odd bit of behavior when I use the auto-generated copy() method that was added in Scala-2.8. From what I've read, when you declare a given class as a case-class, a lot of things are auto-generated for you, one of which is the copy() method. So you can do the following... case class Number(value: Int) val m = Number(6) println(m) // prints 6 println( m.copy(value=7) ) // works fine, prints 7 println( m.copy(value=-7) ) // produces: error: not found: value value println( m.copy(value=(-7)) ) // works fine, prints -7 I apologize if this question has already been asked, but what is going on here?
Tags (comma-separated)
Save Edits
Cancel