Uploaded image for project: 'Scala Programming Language'
  1. Scala Programming Language
  2. SI-5044

The result of a method, taking an object of some case class, can not be assigned to a variable with the name as the name of any field of that class

    Details

      Description

      case class A(
        id: Int = 0,
        name: String = "",
        age: Int = 20
      )
       
      object Tmp {
       
        def m(a: A) = ""
        
        def main(args: Array[String]) {
          val a = A(name = "")
          val name = Tmp.m(a) // compiler error: recursive value a needs type
          println(">")
        }
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rytz Lukas Rytz
                Reporter:
                yaroslav ulanovych Yaroslav Ulanovych
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: