scala.tools.nsc.symtab.Types$$TypeError: type mismatch; found : Product with x$$1.Token required: Product with Test.this.Token

Scala JIRA | Eric Willigers | 9 years ago
  1. 0

    {code} class Test extends scala.util.parsing.combinator.lexical.StdLexical { import scala.util.parsing.combinator.~ // copied from scala.util.parsing.combinator.lexical.StdLexical, then truncated override def token: Parser[Token] = ( letter ~ rep( letter | digit ) ^^ lift2_(processIdent) ) // copied from scala.util.parsing.combinator.lexical.StdLexical, then truncated private def lift2_[T](f: String => T)(p: ~[Char, List[Char]]): T = error("") } {code} Attempt to compile, using 2.6.0-final or 2.6.0.13044.20071010-034529 {code} Exception in thread "main" scala.tools.nsc.symtab.Types$$TypeError: type mismatch; found : Product with x$$1.Token required: Product with Test.this.Token at scala.tools.nsc.typechecker.Contexts$$Context.error(Contexts.scala:348) at scala.tools.nsc.typechecker.Infer$$Inferencer.error(Infer.scala:219) at scala.tools.nsc.typechecker.Infer$$Inferencer.typeError(Infer.scala:229) at scala.tools.nsc.typechecker.Infer$$Inferencer.typeErrorTree(Infer.scala:235) at scala.tools.nsc.typechecker.Typers$$Typer.adapt(Typers.scala:791) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3033) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3075) at scala.tools.nsc.typechecker.Typers$$Typer.transformedOrTyped(Typers.scala:3124) at scala.tools.nsc.typechecker.Typers$$Typer.typedDefDef(Typers.scala:1288) at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2759) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3031) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3064) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.makeAccessor(SuperAccessors.scala:253) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:130) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:185) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer$$$$anonfun$$11.apply(SuperAccessors.scala:188) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer$$$$anonfun$$11.apply(SuperAccessors.scala:188) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.scala$$tools$$nsc$$typechecker$$SuperAccessors$$SuperAccTransformer$$$$withInvalidOwner(SuperAccessors.scala:208) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:187) at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1287) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:191) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$24.apply(Trees.scala:1265) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$24.apply(Trees.scala:1265) at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.atOwner(SuperAccessors.scala:202) at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1264) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:191) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$34.apply(Trees.scala:1376) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$34.apply(Trees.scala:1374) at scala.List$$.loop$$0(List.scala:244) at scala.List$$.mapConserve(List.scala:261) at scala.tools.nsc.ast.Trees$$Transformer.transformStats(Trees.scala:1374) at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1287) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:191) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer$$$$anonfun$$1.apply(SuperAccessors.scala:58) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer$$$$anonfun$$1.apply(SuperAccessors.scala:55) at scala.List$$.map2(List.scala:277) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transformArgs(SuperAccessors.scala:55) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:185) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$25.apply(Trees.scala:1270) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$25.apply(Trees.scala:1269) at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.atOwner(SuperAccessors.scala:202) at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1268) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:191) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$28.apply(Trees.scala:1358) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$28.apply(Trees.scala:1358) at scala.List$$.loop$$0(List.scala:244) at scala.List$$.mapConserve(List.scala:261) at scala.tools.nsc.ast.Trees$$Transformer.transformTrees(Trees.scala:1358) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer$$$$anonfun$$8.apply(SuperAccessors.scala:112) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer$$$$anonfun$$8.apply(SuperAccessors.scala:112) at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.atOwner(SuperAccessors.scala:202) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:112) at scala.tools.nsc.ast.Trees$$Transformer.transformTemplate(Trees.scala:1360) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$22.apply(Trees.scala:1257) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$22.apply(Trees.scala:1257) at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.atOwner(SuperAccessors.scala:202) at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1256) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:99) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$34.apply(Trees.scala:1376) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$34.apply(Trees.scala:1374) at scala.List$$.loop$$0(List.scala:244) at scala.List$$.mapConserve(List.scala:261) at scala.tools.nsc.ast.Trees$$Transformer.transformStats(Trees.scala:1374) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$21.apply(Trees.scala:1253) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$21.apply(Trees.scala:1253) at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.atOwner(SuperAccessors.scala:202) at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1252) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46) at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:191) at scala.tools.nsc.ast.Trees$$Transformer.transformUnit(Trees.scala:1377) at scala.tools.nsc.transform.Transform$$Phase.apply(Transform.scala:30) at scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:243) at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$2.apply(Global.scala:231) at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$2.apply(Global.scala:231) at scala.Iterator$$class.foreach(Iterator.scala:375) at scala.collection.mutable.ListBuffer$$$$anon$$0.foreach(ListBuffer.scala:255) at scala.tools.nsc.Global$$GlobalPhase.run(Global.scala:231) at scala.tools.nsc.Global$$Run.compileSources(Global.scala:533) at scala.tools.nsc.Global$$Run.compile(Global.scala:617) at scala.tools.nsc.Main$$.process(Main.scala:86) at scala.tools.nsc.Main$$.main(Main.scala:107) at scala.tools.nsc.Main.main(Main.scala) {code}

    Scala JIRA | 9 years ago | Eric Willigers
    scala.tools.nsc.symtab.Types$$TypeError: type mismatch; found : Product with x$$1.Token required: Product with Test.this.Token
  2. 0

    Using the nightly build 2.6.0.13307.20071120-125453 {code} class Settings {} abstract class Tool { self => type settingsType <: Settings type moduleType = Module { type settingsType = self.settingsType } val module: moduleType // the compiler crash doesn't occur if we change this to val module: Module } abstract class Module { type settingsType <: Settings def tools(): List[Tool] } final class ToolA(val module: Module {type settingsType = Settings} ) extends Tool { type settingsType = Settings } object MyModule extends Module { type settingsType = Settings def tools(): List[Tool] = List(new ToolA(this)) } object Test { val tools: List[Tool] = MyModule.tools() // the compiler crash doesn't occur if we remove the next line assert(tools.map[Module](_.module) == List(MyModule)) } {code} {code} exception when traversing ((x$$1: Tool) => x$$1.module) exception when traversing Test.this.tools.map[Module](((x$$1: Tool) => x$$1.module)) exception when traversing Test.this.tools.map[Module](((x$$1: Tool) => x$$1.module)).== exception when traversing Test.this.tools.map[Module](((x$$1: Tool) => x$$1.module)).==(scala.List.apply[object MyModule](MyModule)) exception when traversing scala.this.Predef.assert(Test.this.tools.map[Module](((x$$1: Tool) => x$$1.module)).==(scala.List.apply[object MyModule](MyModule))) exception when traversing java.lang.Object with ScalaObject { def this(): object Test = { Test.super.this(); () }; private[this] val tools: List[Tool] = MyModule.tools(); <stable> <accessor> def tools: List[Tool] = Test.this.tools; scala.this.Predef.assert(Test.this.tools.map[Module](((x$$1: Tool) => x$$1.module)).==(scala.List.apply[object MyModule](MyModule))) } exception when traversing final class Test extends java.lang.Object with ScalaObject { def this(): object Test = { Test.super.this(); () }; private[this] val tools: List[Tool] = MyModule.tools(); <stable> <accessor> def tools: List[Tool] = Test.this.tools; scala.this.Predef.assert(Test.this.tools.map[Module](((x$$1: Tool) => x$$1.module)).==(scala.List.apply[object MyModule](MyModule))) } exception when traversing package <empty> { class Settings extends java.lang.Object with ScalaObject { def this(): Settings = { Settings.super.this(); () } }; abstract class Tool extends java.lang.Object with ScalaObject { self => def this(): Tool = { Tool.super.this(); () }; type settingsType>: Nothing <: Settings; type moduleType = Module{type settingsType = Tool.this.settingsType}; <stable> <accessor> def module: Tool.this.moduleType }; abstract class Module extends java.lang.Object with ScalaObject { def this(): Module = { Module.super.this(); () }; type settingsType>: Nothing <: Settings; def tools(): List[Tool] }; final class ToolA extends Tool with ScalaObject { <paramaccessor> private[this] val module: Module{type settingsType = Settings} = _; <stable> <accessor> <paramaccessor> def module: Module{type settingsType = Settings} = ToolA.this.module; def this(module: Module{type settingsType = Settings}): ToolA = { ToolA.super.this(); () }; type settingsType = Settings }; final class MyModule extends Module with ScalaObject { def this(): object MyModule = { MyModule.super.this(); () }; type settingsType = Settings; def tools(): List[Tool] = scala.List.apply[ToolA](new ToolA(this)) }; final class Test extends java.lang.Object with ScalaObject { def this(): object Test = { Test.super.this(); () }; private[this] val tools: List[Tool] = MyModule.tools(); <stable> <accessor> def tools: List[Tool] = Test.this.tools; scala.this.Predef.assert(Test.this.tools.map[Module](((x$$1: Tool) => x$$1.module)).==(scala.List.apply[object MyModule](MyModule))) } } Exception in thread "main" scala.tools.nsc.symtab.Types$$TypeError: type mismatch; found : Module{type settingsType = x$$1.settingsType} required: Module{type settingsType = Tool#settingsType} at scala.tools.nsc.typechecker.Contexts$$Context.error(Contexts.scala:348) at scala.tools.nsc.typechecker.Infer$$Inferencer.error(Infer.scala:229) at scala.tools.nsc.typechecker.Infer$$Inferencer.typeError(Infer.scala:239) at scala.tools.nsc.typechecker.Infer$$Inferencer.typeErrorTree(Infer.scala:245) at scala.tools.nsc.typechecker.Typers$$Typer.adapt(Typers.scala:796) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3025) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3068) at scala.tools.nsc.typechecker.Typers$$Typer.transformedOrTyped(Typers.scala:3117) at scala.tools.nsc.typechecker.Typers$$Typer.typedDefDef(Typers.scala:1297) at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2761) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3023) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3057) at scala.tools.nsc.typechecker.Typers$$Typer.typedStat$$1(Typers.scala:1500) at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$21.apply(Typers.scala:1529) at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$21.apply(Typers.scala:1529) at scala.List$$.loop$$1(List.scala:244) at scala.List$$.mapConserve(List.scala:261) at scala.tools.nsc.typechecker.Typers$$Typer.typedStats(Typers.scala:1529) at scala.tools.nsc.typechecker.Typers$$Typer.typedTemplate(Typers.scala:1147) at scala.tools.nsc.typechecker.Typers$$Typer.typedClassDef(Typers.scala:1019) at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2752) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3023) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3057) at scala.tools.nsc.typechecker.Typers$$Typer.typedStat$$1(Typers.scala:1500) at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$21.apply(Typers.scala:1529) at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$21.apply(Typers.scala:1529) at scala.List$$.loop$$1(List.scala:244) at scala.List$$.mapConserve(List.scala:261) at scala.tools.nsc.typechecker.Typers$$Typer.typedStats(Typers.scala:1529) at scala.tools.nsc.typechecker.Typers$$Typer.typedBlock(Typers.scala:1359) at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2785) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3023) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3057) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transformFunction(UnCurry.scala:312) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.mainTransform(UnCurry.scala:473) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transform(UnCurry.scala:114) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformTrees$$1.apply(Trees.scala:1358) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformTrees$$1.apply(Trees.scala:1358) at scala.List$$.loop$$1(List.scala:244) at scala.List$$.mapConserve(List.scala:261) at scala.tools.nsc.ast.Trees$$Transformer.transformTrees(Trees.scala:1358) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer$$$$anonfun$$mainTransform$$5.apply(UnCurry.scala:442) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer$$$$anonfun$$mainTransform$$5.apply(UnCurry.scala:440) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.withNeedLift$$1(UnCurry.scala:371) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.mainTransform(UnCurry.scala:440) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transform(UnCurry.scala:114) at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1333) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.mainTransform(UnCurry.scala:479) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transform(UnCurry.scala:114) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer$$$$anonfun$$mainTransform$$5.apply(UnCurry.scala:442) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer$$$$anonfun$$mainTransform$$5.apply(UnCurry.scala:440) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.withNeedLift$$1(UnCurry.scala:371) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.mainTransform(UnCurry.scala:440) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transform(UnCurry.scala:114) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformTrees$$1.apply(Trees.scala:1358) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformTrees$$1.apply(Trees.scala:1358) at scala.List$$.loop$$1(List.scala:244) at scala.List$$.mapConserve(List.scala:261) at scala.tools.nsc.ast.Trees$$Transformer.transformTrees(Trees.scala:1358) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer$$$$anonfun$$mainTransform$$5.apply(UnCurry.scala:442) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer$$$$anonfun$$mainTransform$$5.apply(UnCurry.scala:440) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.withNeedLift$$1(UnCurry.scala:371) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.mainTransform(UnCurry.scala:440) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transform(UnCurry.scala:114) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformStats$$1$$$$anonfun$$apply$$3.apply(Trees.scala:1375) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformStats$$1$$$$anonfun$$apply$$3.apply(Trees.scala:1375) at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformStats$$1.apply(Trees.scala:1375) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformStats$$1.apply(Trees.scala:1374) at scala.List$$.loop$$1(List.scala:244) at scala.List$$.mapConserve(List.scala:261) at scala.List$$.loop$$1(List.scala:248) at scala.List$$.mapConserve(List.scala:261) at scala.List$$.loop$$1(List.scala:248) at scala.List$$.mapConserve(List.scala:261) at scala.List$$.loop$$1(List.scala:248) at scala.List$$.mapConserve(List.scala:261) at scala.tools.nsc.ast.Trees$$Transformer.transformStats(Trees.scala:1374) at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1285) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.scala$$tools$$nsc$$transform$$TypingTransformers$$TypingTransformer$$$$super$$transform(TypingTransformers.scala:44) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer$$$$anonfun$$transform$$1.apply(TypingTransformers.scala:44) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer$$$$anonfun$$transform$$1.apply(TypingTransformers.scala:44) at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:44) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.scala$$tools$$nsc$$transform$$UnCurry$$UnCurryTransformer$$$$super$$transform(UnCurry.scala:401) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer$$$$anonfun$$mainTransform$$8.apply(UnCurry.scala:476) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer$$$$anonfun$$mainTransform$$8.apply(UnCurry.scala:476) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.withInConstructorFlag$$1(UnCurry.scala:379) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.mainTransform(UnCurry.scala:476) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transform(UnCurry.scala:114) at scala.tools.nsc.ast.Trees$$Transformer.transformTemplate(Trees.scala:1360) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$2.apply(Trees.scala:1257) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$2.apply(Trees.scala:1257) at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27) at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1256) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.mainTransform(UnCurry.scala:479) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transform(UnCurry.scala:114) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformStats$$1.apply(Trees.scala:1376) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformStats$$1.apply(Trees.scala:1374) at scala.List$$.loop$$1(List.scala:244) at scala.List$$.mapConserve(List.scala:261) at scala.List$$.loop$$1(List.scala:248) at scala.List$$.mapConserve(List.scala:261) at scala.List$$.loop$$1(List.scala:248) at scala.List$$.mapConserve(List.scala:261) at scala.List$$.loop$$1(List.scala:248) at scala.List$$.mapConserve(List.scala:261) at scala.List$$.loop$$1(List.scala:248) at scala.List$$.mapConserve(List.scala:261) at scala.List$$.loop$$1(List.scala:248) at scala.List$$.mapConserve(List.scala:261) at scala.tools.nsc.ast.Trees$$Transformer.transformStats(Trees.scala:1374) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$1.apply(Trees.scala:1253) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$1.apply(Trees.scala:1253) at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27) at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1252) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.mainTransform(UnCurry.scala:479) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transform(UnCurry.scala:114) at scala.tools.nsc.ast.Trees$$Transformer.transformUnit(Trees.scala:1377) at scala.tools.nsc.transform.Transform$$Phase.apply(Transform.scala:30) at scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:243) at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:231) at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:231) at scala.Iterator$$class.foreach(Iterator.scala:375) at scala.collection.mutable.ListBuffer$$$$anon$$1.foreach(ListBuffer.scala:255) at scala.tools.nsc.Global$$GlobalPhase.run(Global.scala:231) at scala.tools.nsc.Global$$Run.compileSources(Global.scala:535) at scala.tools.nsc.Global$$Run.compile(Global.scala:619) at scala.tools.nsc.Main$$.process(Main.scala:86) at scala.tools.nsc.Main$$.main(Main.scala:107) at scala.tools.nsc.Main.main(Main.scala) {code}

    Scala JIRA | 9 years ago | Eric Willigers
    scala.tools.nsc.symtab.Types$$TypeError: type mismatch; found : Module{type settingsType = x$$1.settingsType} required: Module{type settingsType = Tool#settingsType}
  3. 0

    Using the nightly build 2.6.0.13307.20071120-125453 {code} class Settings {} abstract class Tool { self => type settingsType <: Settings type moduleType = Module { type settingsType = self.settingsType } val module: moduleType // the compiler crash doesn't occur if we change this to val module: Module } abstract class Module { type settingsType <: Settings def tools(): List[Tool] } final class ToolA(val module: Module {type settingsType = Settings} ) extends Tool { type settingsType = Settings } object MyModule extends Module { type settingsType = Settings def tools(): List[Tool] = List(new ToolA(this)) } object Test { val tools: List[Tool] = MyModule.tools() // the compiler crash doesn't occur if we remove the next line assert(tools.map[Module](_.module) == List(MyModule)) } {code} {code} exception when traversing ((x$$1: Tool) => x$$1.module) exception when traversing Test.this.tools.map[Module](((x$$1: Tool) => x$$1.module)) exception when traversing Test.this.tools.map[Module](((x$$1: Tool) => x$$1.module)).== exception when traversing Test.this.tools.map[Module](((x$$1: Tool) => x$$1.module)).==(scala.List.apply[object MyModule](MyModule)) exception when traversing scala.this.Predef.assert(Test.this.tools.map[Module](((x$$1: Tool) => x$$1.module)).==(scala.List.apply[object MyModule](MyModule))) exception when traversing java.lang.Object with ScalaObject { def this(): object Test = { Test.super.this(); () }; private[this] val tools: List[Tool] = MyModule.tools(); <stable> <accessor> def tools: List[Tool] = Test.this.tools; scala.this.Predef.assert(Test.this.tools.map[Module](((x$$1: Tool) => x$$1.module)).==(scala.List.apply[object MyModule](MyModule))) } exception when traversing final class Test extends java.lang.Object with ScalaObject { def this(): object Test = { Test.super.this(); () }; private[this] val tools: List[Tool] = MyModule.tools(); <stable> <accessor> def tools: List[Tool] = Test.this.tools; scala.this.Predef.assert(Test.this.tools.map[Module](((x$$1: Tool) => x$$1.module)).==(scala.List.apply[object MyModule](MyModule))) } exception when traversing package <empty> { class Settings extends java.lang.Object with ScalaObject { def this(): Settings = { Settings.super.this(); () } }; abstract class Tool extends java.lang.Object with ScalaObject { self => def this(): Tool = { Tool.super.this(); () }; type settingsType>: Nothing <: Settings; type moduleType = Module{type settingsType = Tool.this.settingsType}; <stable> <accessor> def module: Tool.this.moduleType }; abstract class Module extends java.lang.Object with ScalaObject { def this(): Module = { Module.super.this(); () }; type settingsType>: Nothing <: Settings; def tools(): List[Tool] }; final class ToolA extends Tool with ScalaObject { <paramaccessor> private[this] val module: Module{type settingsType = Settings} = _; <stable> <accessor> <paramaccessor> def module: Module{type settingsType = Settings} = ToolA.this.module; def this(module: Module{type settingsType = Settings}): ToolA = { ToolA.super.this(); () }; type settingsType = Settings }; final class MyModule extends Module with ScalaObject { def this(): object MyModule = { MyModule.super.this(); () }; type settingsType = Settings; def tools(): List[Tool] = scala.List.apply[ToolA](new ToolA(this)) }; final class Test extends java.lang.Object with ScalaObject { def this(): object Test = { Test.super.this(); () }; private[this] val tools: List[Tool] = MyModule.tools(); <stable> <accessor> def tools: List[Tool] = Test.this.tools; scala.this.Predef.assert(Test.this.tools.map[Module](((x$$1: Tool) => x$$1.module)).==(scala.List.apply[object MyModule](MyModule))) } } Exception in thread "main" scala.tools.nsc.symtab.Types$$TypeError: type mismatch; found : Module{type settingsType = x$$1.settingsType} required: Module{type settingsType = Tool#settingsType} at scala.tools.nsc.typechecker.Contexts$$Context.error(Contexts.scala:348) at scala.tools.nsc.typechecker.Infer$$Inferencer.error(Infer.scala:229) at scala.tools.nsc.typechecker.Infer$$Inferencer.typeError(Infer.scala:239) at scala.tools.nsc.typechecker.Infer$$Inferencer.typeErrorTree(Infer.scala:245) at scala.tools.nsc.typechecker.Typers$$Typer.adapt(Typers.scala:796) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3025) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3068) at scala.tools.nsc.typechecker.Typers$$Typer.transformedOrTyped(Typers.scala:3117) at scala.tools.nsc.typechecker.Typers$$Typer.typedDefDef(Typers.scala:1297) at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2761) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3023) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3057) at scala.tools.nsc.typechecker.Typers$$Typer.typedStat$$1(Typers.scala:1500) at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$21.apply(Typers.scala:1529) at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$21.apply(Typers.scala:1529) at scala.List$$.loop$$1(List.scala:244) at scala.List$$.mapConserve(List.scala:261) at scala.tools.nsc.typechecker.Typers$$Typer.typedStats(Typers.scala:1529) at scala.tools.nsc.typechecker.Typers$$Typer.typedTemplate(Typers.scala:1147) at scala.tools.nsc.typechecker.Typers$$Typer.typedClassDef(Typers.scala:1019) at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2752) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3023) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3057) at scala.tools.nsc.typechecker.Typers$$Typer.typedStat$$1(Typers.scala:1500) at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$21.apply(Typers.scala:1529) at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$21.apply(Typers.scala:1529) at scala.List$$.loop$$1(List.scala:244) at scala.List$$.mapConserve(List.scala:261) at scala.tools.nsc.typechecker.Typers$$Typer.typedStats(Typers.scala:1529) at scala.tools.nsc.typechecker.Typers$$Typer.typedBlock(Typers.scala:1359) at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2785) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3023) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3057) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transformFunction(UnCurry.scala:312) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.mainTransform(UnCurry.scala:473) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transform(UnCurry.scala:114) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformTrees$$1.apply(Trees.scala:1358) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformTrees$$1.apply(Trees.scala:1358) at scala.List$$.loop$$1(List.scala:244) at scala.List$$.mapConserve(List.scala:261) at scala.tools.nsc.ast.Trees$$Transformer.transformTrees(Trees.scala:1358) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer$$$$anonfun$$mainTransform$$5.apply(UnCurry.scala:442) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer$$$$anonfun$$mainTransform$$5.apply(UnCurry.scala:440) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.withNeedLift$$1(UnCurry.scala:371) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.mainTransform(UnCurry.scala:440) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transform(UnCurry.scala:114) at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1333) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.mainTransform(UnCurry.scala:479) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transform(UnCurry.scala:114) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer$$$$anonfun$$mainTransform$$5.apply(UnCurry.scala:442) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer$$$$anonfun$$mainTransform$$5.apply(UnCurry.scala:440) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.withNeedLift$$1(UnCurry.scala:371) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.mainTransform(UnCurry.scala:440) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transform(UnCurry.scala:114) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformTrees$$1.apply(Trees.scala:1358) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformTrees$$1.apply(Trees.scala:1358) at scala.List$$.loop$$1(List.scala:244) at scala.List$$.mapConserve(List.scala:261) at scala.tools.nsc.ast.Trees$$Transformer.transformTrees(Trees.scala:1358) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer$$$$anonfun$$mainTransform$$5.apply(UnCurry.scala:442) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer$$$$anonfun$$mainTransform$$5.apply(UnCurry.scala:440) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.withNeedLift$$1(UnCurry.scala:371) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.mainTransform(UnCurry.scala:440) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transform(UnCurry.scala:114) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformStats$$1$$$$anonfun$$apply$$3.apply(Trees.scala:1375) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformStats$$1$$$$anonfun$$apply$$3.apply(Trees.scala:1375) at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformStats$$1.apply(Trees.scala:1375) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformStats$$1.apply(Trees.scala:1374) at scala.List$$.loop$$1(List.scala:244) at scala.List$$.mapConserve(List.scala:261) at scala.List$$.loop$$1(List.scala:248) at scala.List$$.mapConserve(List.scala:261) at scala.List$$.loop$$1(List.scala:248) at scala.List$$.mapConserve(List.scala:261) at scala.List$$.loop$$1(List.scala:248) at scala.List$$.mapConserve(List.scala:261) at scala.tools.nsc.ast.Trees$$Transformer.transformStats(Trees.scala:1374) at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1285) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.scala$$tools$$nsc$$transform$$TypingTransformers$$TypingTransformer$$$$super$$transform(TypingTransformers.scala:44) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer$$$$anonfun$$transform$$1.apply(TypingTransformers.scala:44) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer$$$$anonfun$$transform$$1.apply(TypingTransformers.scala:44) at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:44) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.scala$$tools$$nsc$$transform$$UnCurry$$UnCurryTransformer$$$$super$$transform(UnCurry.scala:401) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer$$$$anonfun$$mainTransform$$8.apply(UnCurry.scala:476) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer$$$$anonfun$$mainTransform$$8.apply(UnCurry.scala:476) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.withInConstructorFlag$$1(UnCurry.scala:379) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.mainTransform(UnCurry.scala:476) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transform(UnCurry.scala:114) at scala.tools.nsc.ast.Trees$$Transformer.transformTemplate(Trees.scala:1360) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$2.apply(Trees.scala:1257) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$2.apply(Trees.scala:1257) at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27) at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1256) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.mainTransform(UnCurry.scala:479) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transform(UnCurry.scala:114) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformStats$$1.apply(Trees.scala:1376) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformStats$$1.apply(Trees.scala:1374) at scala.List$$.loop$$1(List.scala:244) at scala.List$$.mapConserve(List.scala:261) at scala.List$$.loop$$1(List.scala:248) at scala.List$$.mapConserve(List.scala:261) at scala.List$$.loop$$1(List.scala:248) at scala.List$$.mapConserve(List.scala:261) at scala.List$$.loop$$1(List.scala:248) at scala.List$$.mapConserve(List.scala:261) at scala.List$$.loop$$1(List.scala:248) at scala.List$$.mapConserve(List.scala:261) at scala.List$$.loop$$1(List.scala:248) at scala.List$$.mapConserve(List.scala:261) at scala.tools.nsc.ast.Trees$$Transformer.transformStats(Trees.scala:1374) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$1.apply(Trees.scala:1253) at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$1.apply(Trees.scala:1253) at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27) at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1252) at scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.mainTransform(UnCurry.scala:479) at scala.tools.nsc.transform.UnCurry$$UnCurryTransformer.transform(UnCurry.scala:114) at scala.tools.nsc.ast.Trees$$Transformer.transformUnit(Trees.scala:1377) at scala.tools.nsc.transform.Transform$$Phase.apply(Transform.scala:30) at scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:243) at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:231) at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:231) at scala.Iterator$$class.foreach(Iterator.scala:375) at scala.collection.mutable.ListBuffer$$$$anon$$1.foreach(ListBuffer.scala:255) at scala.tools.nsc.Global$$GlobalPhase.run(Global.scala:231) at scala.tools.nsc.Global$$Run.compileSources(Global.scala:535) at scala.tools.nsc.Global$$Run.compile(Global.scala:619) at scala.tools.nsc.Main$$.process(Main.scala:86) at scala.tools.nsc.Main$$.main(Main.scala:107) at scala.tools.nsc.Main.main(Main.scala) {code}

    Scala JIRA | 9 years ago | Eric Willigers
    scala.tools.nsc.symtab.Types$$TypeError: type mismatch; found : Module{type settingsType = x$$1.settingsType} required: Module{type settingsType = Tool#settingsType}
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    The Scala code below {code} class Foo { object a { println("a") } } class Bar extends Foo { object b { //println("b: " + a) //OK println("b: " + Bar.super.a) } } object bug extends Application { new Bar () } {code} produces the following error: {code} exception when typing b.this.Bar$$b$$$$$$outer().Bar$$$$super$$a() b.this.Bar$$b$$$$$$outer().Bar$$$$super$$a of type object Foo#a does not take parameters in file /home/michelou/tmp/bug.scala scala.tools.nsc.symtab.Types$$TypeError: b.this.Bar$$b$$$$$$outer().Bar$$$$super$$a of type object Foo#a does not take parameters at scala.tools.nsc.typechecker.Contexts$$Context.error(Contexts.scala:348) at scala.tools.nsc.typechecker.Infer$$Inferencer.error(Infer.scala:221) at scala.tools.nsc.typechecker.Infer$$Inferencer.errorTree(Infer.scala:225) at scala.tools.nsc.typechecker.Typers$$Typer.doTypedApply(Typers.scala:1786) at scala.tools.nsc.typechecker.Typers$$Typer.typedApply$$0(Typers.scala:2343) at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2924) at scala.tools.nsc.transform.Erasure$$Eraser.typed1(Erasure.scala:501) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3027) at scala.tools.nsc.typechecker.Typers$$Typer.typedArg(Typers.scala:1546) at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$65.apply(Typers.scala:1562) at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$65.apply(Typers.scala:1562) [...] {code}

    Scala JIRA | 9 years ago | Stephane Micheloud
    scala.tools.nsc.symtab.Types$$TypeError: b.this.Bar$$b$$$$$$outer().Bar$$$$super$$a of type object Foo#a does not take parameters
  6. 0

    The Scala code below {code} class Foo { object a { println("a") } } class Bar extends Foo { object b { //println("b: " + a) //OK println("b: " + Bar.super.a) } } object bug extends Application { new Bar () } {code} produces the following error: {code} exception when typing b.this.Bar$$b$$$$$$outer().Bar$$$$super$$a() b.this.Bar$$b$$$$$$outer().Bar$$$$super$$a of type object Foo#a does not take parameters in file /home/michelou/tmp/bug.scala scala.tools.nsc.symtab.Types$$TypeError: b.this.Bar$$b$$$$$$outer().Bar$$$$super$$a of type object Foo#a does not take parameters at scala.tools.nsc.typechecker.Contexts$$Context.error(Contexts.scala:348) at scala.tools.nsc.typechecker.Infer$$Inferencer.error(Infer.scala:221) at scala.tools.nsc.typechecker.Infer$$Inferencer.errorTree(Infer.scala:225) at scala.tools.nsc.typechecker.Typers$$Typer.doTypedApply(Typers.scala:1786) at scala.tools.nsc.typechecker.Typers$$Typer.typedApply$$0(Typers.scala:2343) at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2924) at scala.tools.nsc.transform.Erasure$$Eraser.typed1(Erasure.scala:501) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3027) at scala.tools.nsc.typechecker.Typers$$Typer.typedArg(Typers.scala:1546) at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$65.apply(Typers.scala:1562) at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$65.apply(Typers.scala:1562) [...] {code}

    Scala JIRA | 9 years ago | Stephane Micheloud
    scala.tools.nsc.symtab.Types$$TypeError: b.this.Bar$$b$$$$$$outer().Bar$$$$super$$a of type object Foo#a does not take parameters

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. scala.tools.nsc.symtab.Types$$TypeError

      type mismatch; found : Product with x$$1.Token required: Product with Test.this.Token

      at scala.tools.nsc.typechecker.Contexts$$Context.error()
    2. Scala Compiler
      Trees$$Transformer$$$$anonfun$$34.apply
      1. scala.tools.nsc.typechecker.Contexts$$Context.error(Contexts.scala:348)
      2. scala.tools.nsc.typechecker.Infer$$Inferencer.error(Infer.scala:219)
      3. scala.tools.nsc.typechecker.Infer$$Inferencer.typeError(Infer.scala:229)
      4. scala.tools.nsc.typechecker.Infer$$Inferencer.typeErrorTree(Infer.scala:235)
      5. scala.tools.nsc.typechecker.Typers$$Typer.adapt(Typers.scala:791)
      6. scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3033)
      7. scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3075)
      8. scala.tools.nsc.typechecker.Typers$$Typer.transformedOrTyped(Typers.scala:3124)
      9. scala.tools.nsc.typechecker.Typers$$Typer.typedDefDef(Typers.scala:1288)
      10. scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2759)
      11. scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3031)
      12. scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3064)
      13. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.makeAccessor(SuperAccessors.scala:253)
      14. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:130)
      15. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:185)
      16. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer$$$$anonfun$$11.apply(SuperAccessors.scala:188)
      17. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer$$$$anonfun$$11.apply(SuperAccessors.scala:188)
      18. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.scala$$tools$$nsc$$typechecker$$SuperAccessors$$SuperAccTransformer$$$$withInvalidOwner(SuperAccessors.scala:208)
      19. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:187)
      20. scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1287)
      21. scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46)
      22. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:191)
      23. scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$24.apply(Trees.scala:1265)
      24. scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$24.apply(Trees.scala:1265)
      25. scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382)
      26. scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33)
      27. scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27)
      28. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.atOwner(SuperAccessors.scala:202)
      29. scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1264)
      30. scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46)
      31. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:191)
      32. scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$34.apply(Trees.scala:1376)
      33. scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$34.apply(Trees.scala:1374)
      33 frames
    3. Scala
      List$$.mapConserve
      1. scala.List$$.loop$$0(List.scala:244)
      2. scala.List$$.mapConserve(List.scala:261)
      2 frames
    4. Scala Compiler
      SuperAccessors$$SuperAccTransformer$$$$anonfun$$1.apply
      1. scala.tools.nsc.ast.Trees$$Transformer.transformStats(Trees.scala:1374)
      2. scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1287)
      3. scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46)
      4. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:191)
      5. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer$$$$anonfun$$1.apply(SuperAccessors.scala:58)
      6. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer$$$$anonfun$$1.apply(SuperAccessors.scala:55)
      6 frames
    5. Scala
      List$$.map2
      1. scala.List$$.map2(List.scala:277)
      1 frame
    6. Scala Compiler
      Trees$$Transformer$$$$anonfun$$28.apply
      1. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transformArgs(SuperAccessors.scala:55)
      2. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:185)
      3. scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$25.apply(Trees.scala:1270)
      4. scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$25.apply(Trees.scala:1269)
      5. scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382)
      6. scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33)
      7. scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27)
      8. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.atOwner(SuperAccessors.scala:202)
      9. scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1268)
      10. scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46)
      11. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:191)
      12. scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$28.apply(Trees.scala:1358)
      13. scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$28.apply(Trees.scala:1358)
      13 frames
    7. Scala
      List$$.mapConserve
      1. scala.List$$.loop$$0(List.scala:244)
      2. scala.List$$.mapConserve(List.scala:261)
      2 frames
    8. Scala Compiler
      Trees$$Transformer$$$$anonfun$$34.apply
      1. scala.tools.nsc.ast.Trees$$Transformer.transformTrees(Trees.scala:1358)
      2. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer$$$$anonfun$$8.apply(SuperAccessors.scala:112)
      3. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer$$$$anonfun$$8.apply(SuperAccessors.scala:112)
      4. scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382)
      5. scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33)
      6. scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27)
      7. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.atOwner(SuperAccessors.scala:202)
      8. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:112)
      9. scala.tools.nsc.ast.Trees$$Transformer.transformTemplate(Trees.scala:1360)
      10. scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$22.apply(Trees.scala:1257)
      11. scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$22.apply(Trees.scala:1257)
      12. scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382)
      13. scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33)
      14. scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27)
      15. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.atOwner(SuperAccessors.scala:202)
      16. scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1256)
      17. scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46)
      18. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:99)
      19. scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$34.apply(Trees.scala:1376)
      20. scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$34.apply(Trees.scala:1374)
      20 frames
    9. Scala
      List$$.mapConserve
      1. scala.List$$.loop$$0(List.scala:244)
      2. scala.List$$.mapConserve(List.scala:261)
      2 frames
    10. Scala Compiler
      Global$$GlobalPhase$$$$anonfun$$2.apply
      1. scala.tools.nsc.ast.Trees$$Transformer.transformStats(Trees.scala:1374)
      2. scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$21.apply(Trees.scala:1253)
      3. scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$21.apply(Trees.scala:1253)
      4. scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1382)
      5. scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:33)
      6. scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.atOwner(TypingTransformers.scala:27)
      7. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.atOwner(SuperAccessors.scala:202)
      8. scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1252)
      9. scala.tools.nsc.transform.TypingTransformers$$TypingTransformer.transform(TypingTransformers.scala:46)
      10. scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:191)
      11. scala.tools.nsc.ast.Trees$$Transformer.transformUnit(Trees.scala:1377)
      12. scala.tools.nsc.transform.Transform$$Phase.apply(Transform.scala:30)
      13. scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:243)
      14. scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$2.apply(Global.scala:231)
      15. scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$2.apply(Global.scala:231)
      15 frames
    11. Scala
      ListBuffer$$$$anon$$0.foreach
      1. scala.Iterator$$class.foreach(Iterator.scala:375)
      2. scala.collection.mutable.ListBuffer$$$$anon$$0.foreach(ListBuffer.scala:255)
      2 frames
    12. Scala Compiler
      Main.main
      1. scala.tools.nsc.Global$$GlobalPhase.run(Global.scala:231)
      2. scala.tools.nsc.Global$$Run.compileSources(Global.scala:533)
      3. scala.tools.nsc.Global$$Run.compile(Global.scala:617)
      4. scala.tools.nsc.Main$$.process(Main.scala:86)
      5. scala.tools.nsc.Main$$.main(Main.scala:107)
      6. scala.tools.nsc.Main.main(Main.scala)
      6 frames