Skip to content

Referencing before declaration: def f1 = v1 ; val v1 = 0 #229

Open
@valtih1978

Description

@valtih1978

Scala Worksheet 0.4.0.v-2_11-201509281548-ab29b9c refuses to run

object o2 {

    def abc = zero ; val zero = 1

}

despite I see that it is compilable in http://scastie.org/12942

Originally, I have discovered it a bit longer form, http://scastie.org/12932

object o2 {
    case class E() {

        def abc = zero match {
                case _ => 2
            }

    }
    val zero = E()
    zero.abc
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions