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

Wrong location reported for badkey errors

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 23.0, 22.3
    • Fix Version/s: 23.1
    • Component/s: compiler
    • Labels:
      None

      Description

      Given the module test:

      -module(test).
      
      -compile(export_all).
      
      test() ->
        Map = #{<<"a">> => 1},
        case maps:get(<<"a">>, Map, undefinied) of % line 7
          _ ->
            Map#{a := 2} % line 9
        end.
      

      When test:test() is called the location of the {badkey,a} error is reported incorrectly as line 7, not as line 9.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: