================================================================================
Simple type declaration
================================================================================
type String = string
--------------------------------------------------------------------------------

(source_file
  (type_declaration
    (identifier)
    (plain_type
      (type_reference_expression
        (identifier)))))

================================================================================
Simple type declaration with visibility modifier
================================================================================
pub type String = string
--------------------------------------------------------------------------------

(source_file
  (type_declaration
    (visibility_modifiers)
    (identifier)
    (plain_type
      (type_reference_expression
        (identifier)))))

================================================================================
Generic type declaration
================================================================================
type Container[T] = []T
--------------------------------------------------------------------------------

(source_file
  (type_declaration
    (identifier)
    (generic_parameters
      (generic_parameter
        (identifier)))
    (plain_type
      (array_type
        (plain_type
          (type_reference_expression
            (identifier)))))))

================================================================================
Generic type declaration with several parameters
================================================================================
type Container[T, U] = map[T]U
--------------------------------------------------------------------------------

(source_file
  (type_declaration
    (identifier)
    (generic_parameters
      (generic_parameter
        (identifier))
      (generic_parameter
        (identifier)))
    (plain_type
      (map_type
        (plain_type
          (type_reference_expression
            (identifier)))
        (plain_type
          (type_reference_expression
            (identifier)))))))

================================================================================
Simple sum type declaration
================================================================================
type Height = string | int
--------------------------------------------------------------------------------

(source_file
  (type_declaration
    (identifier)
    (plain_type
      (type_reference_expression
        (identifier)))
    (plain_type
      (type_reference_expression
        (identifier)))))

================================================================================
Sum type declaration with several types
================================================================================
type Height = string | int | float
--------------------------------------------------------------------------------

(source_file
  (type_declaration
    (identifier)
    (plain_type
      (type_reference_expression
        (identifier)))
    (plain_type
      (type_reference_expression
        (identifier)))
    (plain_type
      (type_reference_expression
        (identifier)))))

================================================================================
Sum type declaration with same type
================================================================================
type Height = string | int | []Height
--------------------------------------------------------------------------------

(source_file
  (type_declaration
    (identifier)
    (plain_type
      (type_reference_expression
        (identifier)))
    (plain_type
      (type_reference_expression
        (identifier)))
    (plain_type
      (array_type
        (plain_type
          (type_reference_expression
            (identifier)))))))

================================================================================
Sum type declaration with several types on each line
================================================================================
type Height = string |
    int |
    float
--------------------------------------------------------------------------------

(source_file
  (type_declaration
    (identifier)
    (plain_type
      (type_reference_expression
        (identifier)))
    (plain_type
      (type_reference_expression
        (identifier)))
    (plain_type
      (type_reference_expression
        (identifier)))))

================================================================================
Sum type declaration with several types on each line, first line is empty
================================================================================
type Height =
    string |
    int |
    float
--------------------------------------------------------------------------------

(source_file
  (type_declaration
    (identifier)
    (plain_type
      (type_reference_expression
        (identifier)))
    (plain_type
      (type_reference_expression
        (identifier)))
    (plain_type
      (type_reference_expression
        (identifier)))))

================================================================================
Sum type declaration with several types on each line and trailing pipe
================================================================================
type Height =
    string |
    int |
    float |
--------------------------------------------------------------------------------

(source_file
  (type_declaration
    (identifier)
    (plain_type
      (type_reference_expression
        (identifier)))
    (plain_type
      (type_reference_expression
        (identifier)))
    (plain_type
      (type_reference_expression
        (identifier)))
    (plain_type
      (type_reference_expression
        (MISSING identifier))))
  (comment
    (MISSING _comment)))
