scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

RangePositions$$ValidateError on codecompletion in NetBeans #2633

Closed scabug closed 13 years ago

scabug commented 14 years ago

Preamble: I wasn't going to open the ticket - the issue takes place while using NetBeans plugin - but both Miles and Caoyuan have recommended me to open.

Accidentally, during editing, there was such fragment in editor:

  def this.

After hitting '.' the error shown below rises. I have tried to reproduce - it was reproduced always.

org.netbeans.modules.scala.core.interactive.RangePositions$$ValidateError: Enclosing tree r10256 does not include tree r10254
        at org.netbeans.modules.scala.core.interactive.RangePositions$$class.error$$1(RangePositions.scala:203)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$class.validate$$1(RangePositions.scala:217)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:85)
        at scala.collection.immutable.List.foreach(List.scala:29)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$class.validate$$1(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:85)
        at scala.collection.immutable.List.foreach(List.scala:29)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$class.validate$$1(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:85)
        at scala.collection.immutable.List.foreach(List.scala:29)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$class.validate$$1(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:85)
        at scala.collection.immutable.List.foreach(List.scala:29)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$class.validate$$1(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:85)
        at scala.collection.immutable.List.foreach(List.scala:29)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$class.validate$$1(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:85)
        at scala.collection.immutable.List.foreach(List.scala:29)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$class.validate$$1(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:85)
        at scala.collection.immutable.List.foreach(List.scala:29)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$class.validate$$1(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:85)
        at scala.collection.immutable.List.foreach(List.scala:29)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$class.validate$$1(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:85)
        at scala.collection.immutable.List.foreach(List.scala:29)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$class.validate$$1(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$$$anonfun$$validate$$1$$8.apply(RangePositions.scala:235)
        at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:85)
        at scala.collection.immutable.List.foreach(List.scala:29)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$class.validate$$1(RangePositions.scala:235)
        at org.netbeans.modules.scala.core.interactive.RangePositions$$class.validatePositions(RangePositions.scala:239)
        at org.netbeans.modules.scala.core.interactive.Global.validatePositions(Global.scala:20)
        at org.netbeans.modules.scala.core.interactive.Global.parse(Global.scala:259)
        at org.netbeans.modules.scala.core.interactive.Global$$$$anonfun$$reloadSources$$1.apply(Global.scala:307)
        at org.netbeans.modules.scala.core.interactive.Global$$$$anonfun$$reloadSources$$1.apply(Global.scala:304)
        at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:85)
        at scala.collection.immutable.List.foreach(List.scala:29)
        at org.netbeans.modules.scala.core.interactive.Global.reloadSources(Global.scala:304)
        at org.netbeans.modules.scala.core.interactive.Global.typedTreeAt(Global.scala:323)
        at org.netbeans.modules.scala.core.interactive.Global.typeMembers(Global.scala:419)
        at org.netbeans.modules.scala.core.interactive.Global$$$$anonfun$$getTypeCompletion$$1.apply(Global.scala:414)
        at org.netbeans.modules.scala.core.interactive.Global$$$$anonfun$$getTypeCompletion$$1.apply(Global.scala:414)
        at org.netbeans.modules.scala.core.interactive.Global.respond(Global.scala:290)
        at org.netbeans.modules.scala.core.interactive.Global.getTypeCompletion(Global.scala:414)
        at org.netbeans.modules.scala.core.interactive.CompilerControl$$$$anon$$2.apply(CompilerControl.scala:105)
        at org.netbeans.modules.scala.core.interactive.CompilerControl$$$$anon$$2.apply(CompilerControl.scala:104)
        at org.netbeans.modules.scala.core.interactive.Global.pollForWork(Global.scala:139)
[catch] at org.netbeans.modules.scala.core.interactive.Global$$$$anon$$2.run(Global.scala:200)
scabug commented 14 years ago

Imported From: https://issues.scala-lang.org/browse/SI-2633?orig=1 Reporter: @gaydenko

scabug commented 14 years ago

@milessabin said: I can't reproduce this on trunk, because it was fixed in r19144. Positions can't (currently) be guaranteed to be valid in the presence of errors syntax or type errors, so validation is only performed if there are none.