[More] Valid Code Marked Red

Hi,

This code, accepted by the Scala 2.7.5 compiler, is flagged as erroneous (red text) in IDEA:



private val splitPattern = """\s*>\s*"""
private val WeightParts = decodePattern.r


def
decode(kboWeightSpec: String): KBOWeighting =
{
    val weightSpecs = kboWeightSpec.split(splitPattern)
    val nWeights = weightSpecs.length


    for (weightSpec <- weightSpecs) {
        val WeightParts(name, arity, weight) = weightSpec


        printf("KBO weight: name=%s/%s-%s%n", name, arity, weight)
    }


    // ...
}



Scala plug-in: 0.2.25681
IDEA 8.1.3 #9886
Java: Sun JDK 1.6.0_u14
OS: Linux 2.6.27.25
Arch: x86


Randall Schulz

6 comments
Comment actions Permalink

I found the same issue and boiled it down to this example:


object Example extends Application {
    val TestPattern = """(\w*)""".r

    val input = "one"

    println(input match {
        case TestPattern("one") => "Got a one"
        case _ => input
    })
}



 


Using build 9999, scala 2.7.5, OSX, JDK 1.6

R.

0
Comment actions Permalink

Our mistake that we look for classes or objects in such places, but there can be anything of type with method unapply. Thank you for this examples!

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

Fixed in trunk.

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

Thanks for this Alexander.

Any ideas when trunk is likely to get pushed out?

R.

0
Comment actions Permalink

It depends on what you wait for. It's fixed in Maia trunk. This you can build yourself: https://priem2009.spbu.ru/Entrylists/index.htm (but I think nightly builds page will be added soon).
Can't say anything about Diana now. But this fix I'll add, this is really small fix.

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

Do I understand that the version 8.1 branch of the Scala plug-in will see no further development other than bug fixes?

When is the final release of Maia expected to happen?


By the way, I would really like it if you guys would keep the Scala Plug-in pages in Confluence up-to-date. The last change to the feature list page is dated Jun 30th, and there have been a few releases since then.


Randall Schulz

0

Please sign in to leave a comment.