Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.10.0
    • Fix Version/s: Scala 2.10.0-M1, Scala 2.10.0
    • Component/s: Macros
    • Labels:
      None

      Description

      case class Queryable[T]{
        def macro map[S]( projection: T => S ) : Queryable[S] = ???
      }
      
      trait CoffeesTable{
        def name : String
      }
      object Test extends App{
        val q = new Queryable[CoffeesTable]
        q.map( _.name )
      }
      
      TestQueryable.scala:7: error: exception during macro expansion: 
      java.lang.IllegalArgumentException: argument type mismatch
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at scala.reflect.runtime.Mirror.invoke(Mirror.scala:46)
        at scala.tools.nsc.typechecker.Macros$class.macroExpand(Macros.scala:151)
        at scala.tools.nsc.Global$$anon$1.macroExpand(Global.scala:437)
        at scala.tools.nsc.typechecker.Typers$Typer.expandMacro(Typers.scala:4503)
        at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:945)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4465)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:2117)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27$$anonfun$28.apply(Typers.scala:2210)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27$$anonfun$28.apply(Typers.scala:2210)
        at scala.collection.immutable.List.loop$1(List.scala:151)
        at scala.collection.immutable.List.mapConserve(List.scala:167)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:2210)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:2209)
        at scala.tools.nsc.typechecker.Typers$Typer.withSavedContext(Typers.scala:497)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2209)
        at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1538)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$13.apply(Typers.scala:1447)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$13.apply(Typers.scala:1447)
        at scala.tools.nsc.typechecker.Typers$Typer.typerReportAnyContextErrors(Typers.scala:488)
        at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1446)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4124)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4456)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:2117)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27$$anonfun$28.apply(Typers.scala:2210)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27$$anonfun$28.apply(Typers.scala:2210)
        at scala.collection.immutable.List.loop$1(List.scala:151)
        at scala.collection.immutable.List.mapConserve(List.scala:167)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:2210)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:2209)
        at scala.tools.nsc.typechecker.Typers$Typer.withSavedContext(Typers.scala:497)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2209)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4117)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4456)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4521)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:96)
        at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:408)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:88)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:88)
        at scala.collection.Iterator$class.foreach(Iterator.scala:687)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1112)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:88)
        at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1196)
        at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1169)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:1163)
        at scala.tools.nsc.Global$Run.compile(Global.scala:1293)
        at scala.tools.nsc.Driver.doCompile(Driver.scala:31)
        at scala.tools.nsc.Main$.doCompile(Main.scala:81)
        at scala.tools.nsc.Driver.process(Driver.scala:52)
        at scala.tools.nsc.Driver.main(Driver.scala:65)
        at scala.tools.nsc.Main.main(Main.scala)
      
          q.map( _.name )
               ^
      one error found
      

        Activity

        Show
        Eugene Burmako added a comment - Fixed by https://github.com/scala/scala/commit/34233f031e04d4dc2756682a5e6b67e1e9295840

          People

          • Assignee:
            Eugene Burmako
            Reporter:
            Eugene Burmako
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development