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

Defining type as a tuple containing a fun() followed by expression throws Emacs error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Help Wanted
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 19.0.2
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
      None

      Description

      Example code (erlang-indent-current-buffer):

      -type b() :: {fun()}.
      a(V) ->
          V.
      
      -module(amqp_leader_proc).
      
      -type routine() :: {fun((any()) -> any()), any()}.
      -type routines() :: [].
      

      Emacs error thrown:
      Unbalanced parenthesis

      Note: if no expression follows the first type definition no error is thrown.
      Note: once the error is thrown indentation halts thus the rest of the file is not checked.

      Minified test cases: https://github.com/fenollp/erlang-formatter/pull/8/files
      Formatting code used: https://github.com/fenollp/erlang-formatter/blob/issue4/fmt.el

        Attachments

          Activity

            People

            Assignee:
            otp_team_ps Team PS
            Reporter:
            fenollp fenollp
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: