Created
April 5, 2013 13:32
-
-
Save kiritsuku/5319290 to your computer and use it in GitHub Desktop.
bug in scalac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ scalac -Yrangepos -Xprint-pos -Xprint:parser,typer y.scala | |
| [[syntax trees at end of parser]] // y.scala | |
| [0:171]package [0:0]<empty> { | |
| [0:51]object X extends [9:51][52]scala.AnyRef { | |
| [9]def <init>() = [9]{ | |
| [9][9][9]super.<init>(); | |
| [9]() | |
| }; | |
| [13:26]val d = [21:26][21:26][21:26]new [25:26]D(); | |
| [29:49][29:37]d.method([38:48][38:43]value = [46:48]10) | |
| }; | |
| [52:76]import language.dynamics; | |
| [77:171]class D extends [85:171][93:100]Dynamic { | |
| [85]def <init>() = [85]{ | |
| [85][85][85]super.<init>(); | |
| [85]() | |
| }; | |
| [105:169]def applyDynamicNamed([127:139]name: [133:139]String)([141:161]value: [148:161][148]scala.Tuple2[[149:155]String, [157:160]Any]) = [165:169]name | |
| } | |
| } | |
| ======= Position error | |
| Unpositioned tree #393 | |
| unpositioned [L -1 P# 394] #393 [NoPosition] Apply // Apply(method apply) | |
| enclosing [L 3 ] #394 [29:49] Apply // (value = 10) | |
| sibling [L 3 P# 394] #367 [29:30] Apply // d. | |
| sibling [L -1 P# 394] #393 [NoPosition] Apply // Apply(method apply) | |
| While validating #442 | |
| [L 1 ] #442 [0:171] PackageDef // object X { | |
| Children: | |
| [L 1 P# 442] #98 [0:0] Ident // o | |
| [L 1 P# 442] #396 [0:51] ModuleDef // X { | |
| [L 5 P# 442] #399 [52:76] Import // language.dynamics | |
| [L 6 P# 442] #441 [77:171] ClassDef // D extends Dynamic { | |
| ======= | |
| error: | |
| while compiling: y.scala | |
| during phase: typer | |
| library version: version 2.10.0 | |
| compiler version: version 2.10.0 | |
| reconstructed args: -Yrangepos -Xprint:parser -Xprint:typer -Xprint-pos | |
| last tree to typer: TypeTree(class String) | |
| symbol: class String in package lang (flags: final <java>) | |
| symbol definition: final class String extends Serializable with Comparable[String] with CharSequence | |
| tpe: String | |
| symbol owners: class String -> package lang | |
| context owners: method applyDynamicNamed -> class D -> package <empty> | |
| == Enclosing template or block == | |
| [105:169]DefDef( // def applyDynamicNamed(name: String)(value: (String, Any)): String in class D | |
| <method> <triedcooking> | |
| "applyDynamicNamed" | |
| [] | |
| // 2 parameter lists | |
| [127:139]ValDef( // name: String | |
| <param> <triedcooking> | |
| "name" | |
| [133:139]"String" | |
| <empty> | |
| ) | |
| [141:161]ValDef( // value: (String, Any) | |
| <param> | |
| "value" | |
| [148:161]AppliedTypeTree( // case class Tuple2[+T1, +T2] extends Product2[T1,T2] with Product with Serializable in package scala | |
| [148]"scala".[148]"Tuple2" // case class Tuple2[+T1, +T2] extends Product2[T1,T2] with Product with Serializable in package scala, tree.tpe=Tuple2 | |
| // 2 arguments | |
| [149:155]"String" | |
| [157:160]"Any" | |
| ) | |
| <empty> | |
| ) | |
| [109]<tpt> // tree.tpe=String | |
| [165:169]"name" // name: String, tree.tpe=String | |
| ) | |
| == Expanded type of tree == | |
| AliasTypeRef( | |
| pre = SingleType(pre = ThisType(package scala), object Predef) | |
| Alias(type String = String) | |
| normalize = TypeRef( | |
| TypeSymbol( | |
| final class String extends Serializable with Comparable[String] with CharSequence | |
| ) | |
| ) | |
| ) | |
| uncaught exception during compilation: scala.tools.nsc.interactive.RangePositions$ValidateException | |
| error: scala.tools.nsc.interactive.RangePositions$ValidateException: Unpositioned tree #393 | |
| at scala.tools.nsc.interactive.RangePositions$class.positionError$1(RangePositions.scala:201) | |
| at scala.tools.nsc.interactive.RangePositions$class.validate$1(RangePositions.scala:211) | |
| at scala.tools.nsc.interactive.RangePositions$class.validate$1(RangePositions.scala:241) | |
| at scala.tools.nsc.interactive.RangePositions$class.validate$1(RangePositions.scala:241) | |
| at scala.tools.nsc.interactive.RangePositions$class.validate$1(RangePositions.scala:241) | |
| at scala.tools.nsc.interactive.RangePositions$class.validate$1(RangePositions.scala:241) | |
| at scala.tools.nsc.interactive.RangePositions$class.validatePositions(RangePositions.scala:246) | |
| at scala.tools.nsc.Main$$anon$1.validatePositions(Main.scala:73) | |
| at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:99) | |
| at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:461) | |
| at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:90) | |
| at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:90) | |
| at scala.collection.Iterator$class.foreach(Iterator.scala:727) | |
| at scala.collection.AbstractIterator.foreach(Iterator.scala:1156) | |
| at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:90) | |
| at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1574) | |
| at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1548) | |
| at scala.tools.nsc.Global$Run.compileSources(Global.scala:1544) | |
| at scala.tools.nsc.Global$Run.compile(Global.scala:1654) | |
| at scala.tools.nsc.Driver.doCompile(Driver.scala:33) | |
| at scala.tools.nsc.Main$.doCompile(Main.scala:79) | |
| at scala.tools.nsc.Driver.process(Driver.scala:54) | |
| at scala.tools.nsc.Driver.main(Driver.scala:67) | |
| at scala.tools.nsc.Main.main(Main.scala) | |
| Exception in thread "main" scala.tools.nsc.interactive.RangePositions$ValidateException: Unpositioned tree #393 | |
| at scala.tools.nsc.interactive.RangePositions$class.positionError$1(RangePositions.scala:201) | |
| at scala.tools.nsc.interactive.RangePositions$class.validate$1(RangePositions.scala:211) | |
| at scala.tools.nsc.interactive.RangePositions$class.validate$1(RangePositions.scala:241) | |
| at scala.tools.nsc.interactive.RangePositions$class.validate$1(RangePositions.scala:241) | |
| at scala.tools.nsc.interactive.RangePositions$class.validate$1(RangePositions.scala:241) | |
| at scala.tools.nsc.interactive.RangePositions$class.validate$1(RangePositions.scala:241) | |
| at scala.tools.nsc.interactive.RangePositions$class.validatePositions(RangePositions.scala:246) | |
| at scala.tools.nsc.Main$$anon$1.validatePositions(Main.scala:73) | |
| at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:99) | |
| at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:461) | |
| at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:90) | |
| at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:90) | |
| at scala.collection.Iterator$class.foreach(Iterator.scala:727) | |
| at scala.collection.AbstractIterator.foreach(Iterator.scala:1156) | |
| at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:90) | |
| at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1574) | |
| at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1548) | |
| at scala.tools.nsc.Global$Run.compileSources(Global.scala:1544) | |
| at scala.tools.nsc.Global$Run.compile(Global.scala:1654) | |
| at scala.tools.nsc.Driver.doCompile(Driver.scala:33) | |
| at scala.tools.nsc.Main$.doCompile(Main.scala:79) | |
| at scala.tools.nsc.Driver.process(Driver.scala:54) | |
| at scala.tools.nsc.Driver.main(Driver.scala:67) | |
| at scala.tools.nsc.Main.main(Main.scala) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object X { | |
| val d = new D | |
| d.method(value = 10) | |
| } | |
| import language.dynamics | |
| class D extends Dynamic { | |
| def applyDynamicNamed(name: String)(value: (String, Any)) = name | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment