Scala Programming Language
  1. Scala Programming Language
  2. SI-6755

Macros: interface for communicating with type inference

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Macros
    • Labels:
      None

      Description

      Currently macros don't expand unless all the type arguments are inferred. This means that type inference uses the return types of macro defs rather than actual types of expansions.

      This is a sane design decision (otherwise typetag generation wouldn't work), but it's inconsistent with how macro return types work when type inference isn't involved: http://stackoverflow.com/questions/13669974/static-return-type-of-scala-macros.

      To fix the inconsistency we should expand macros at will, giving them a possibility to control their pre-inference shape and a post-inference hook to transform early expansions after type arguments are inferred.

        Activity

        Show
        Eugene Burmako added a comment - - edited See some progress here: https://github.com/scalamacros/kepler/tree/topic/implicit-macros . upd. Moved to http://docs.scala-lang.org/overviews/macros/inference.html .
        Hide
        Eugene Burmako added a comment -

        Looks like this is no longer necessary: https://github.com/scala/scala/pull/2494

        Show
        Eugene Burmako added a comment - Looks like this is no longer necessary: https://github.com/scala/scala/pull/2494

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development