scala-ide / scala-worksheet

A Scala IDE plugin for a multi-line REPL (called worksheet)
96 stars 24 forks source link

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

Open valtih1978 opened 9 years ago

valtih1978 commented 9 years ago

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
}
valtih1978 commented 9 years ago

I flipped declaration order

   val zero = 1
   def abc = zero

to work around

valtih1978 commented 9 years ago

Probably, you can integrate a standard compiler instead of relying on your own for better quality and specification conformity. Is it possible?

Which guidelines did you use to learn Eclipse worksheets/plugins? Do you have a guideline for getting involved developers? I am more interested to know how to program worksheets in principle.

kiritsuku commented 9 years ago

We use the standard compiler scalac. The problems arise because the document needs to be crippled apart. If you are interested to contribute to the worksheet or if you want to get details about its internals, you should speak up at scala-ide-dev or on gitter.

valtih1978 commented 8 years ago

Gitter page in Wikipedia says that you should have a gitter badge at your README file.

[![Join the chat at https://gitter.im/scala-ide/scala-ide](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/scala-ide/scala-ide)

Join the chat at https://gitter.im/scala-ide/scala-ide