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

c.reify behaves differently from c.universe.reify

    Details

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

      Description

      This happens because c.reify uses c.mirror, but c.universe.reify uses c.universe.mirror (which, for one, bails on packageless classes).

        Activity

        Hide
        Paul Phillips added a comment -

        I ran into this the hard way, and it was brutal. If the standard thing to do when one is writing a macro is to start with "import c.universe._" then right away we have "reify" and "c.reify" doing different-but-the-same things – and I have a feeling there is more where that came from. Can something be done to limit the frequency with which same-named almost-the-same identifiers arise?

        Show
        Paul Phillips added a comment - I ran into this the hard way, and it was brutal. If the standard thing to do when one is writing a macro is to start with "import c.universe._" then right away we have "reify" and "c.reify" doing different-but-the-same things – and I have a feeling there is more where that came from. Can something be done to limit the frequency with which same-named almost-the-same identifiers arise?
        Show
        Adriaan Moors added a comment - https://github.com/scala/scala/pull/936

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development