Skip to content

Multiline record pattern match errors #149

@rynoV

Description

@rynoV

For example:

diff --git a/test/corpus/patterns.txt b/test/corpus/patterns.txt
index e2ae7a1..0b4177d 100644
--- a/test/corpus/patterns.txt
+++ b/test/corpus/patterns.txt
@@ -270,6 +270,24 @@ let f =
             (const
               (unit))))))))
 
+================================================================================
+multiline record patterns
+================================================================================
+
+type T() =
+  let v =
+      match immutQuery with
+      | { Field1 = 1
+          Field2 = true } -> ()
+      | { Field1 = 2
+          Field2 = false } -> ()
+
+  do ()
+
+--------------------------------------------------------------------------------
+
+
+
 ================================================================================
 empty list pattern
 ================================================================================

Results in:

    (ERROR
      (type_name
        (identifier))
      (primary_constr_args)
      (value_declaration_left
        (identifier_pattern
          (long_identifier_or_op
            (identifier))))
      (application_expression
        (match_expression
          (long_identifier_or_op
            (identifier))
          (rules
            (rule
              (record_pattern
                (field_pattern
                  (long_identifier
                    (identifier))
                  (ERROR
                    (int))
                  (identifier_pattern
                    (long_identifier_or_op
                      (identifier))
                    (ERROR)
                    (const
                      (bool)))))
              (const
                (unit)))
            (rule
              (record_pattern
                (field_pattern
                  (long_identifier
                    (identifier))
                  (ERROR
                    (int)
                    (identifier))
                  (const
                    (bool))))
              (const
                (unit)))))
        (do_expression
          (const
            (unit)))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions