Uploaded image for project: 'Erlang/OTP'
  1. Erlang/OTP
  2. ERL-1380

Repeated stacktrace variable not refused

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 23.0
    • Fix Version/s: 24.0
    • Component/s: compiler
    • Labels:
      None

      Description

      The following program compiles fine, treating the repeated appearance of variable Repeat as distinct (the variable is bound to the value of the stacktrace).
       

      -module(test).
      
      -compile(export_all).
      
      t(F) ->
          try F()
          catch
              _:Repeat:Repeat -> Repeat
          end.
      

      This should be refused by the compiler and an error issued saying the stacktrace variable can't be reused in the pattern.

        Attachments

          Activity

            People

            Assignee:
            bjorn Björn Gustavsson
            Reporter:
            michalmuskala Michał Muskała
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: