Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing "unpack" during coercion #250

Open
CarlOlson opened this issue Jun 27, 2024 · 0 comments
Open

Missing "unpack" during coercion #250

CarlOlson opened this issue Jun 27, 2024 · 0 comments

Comments

@CarlOlson
Copy link
Contributor

type t<'a> = float

let zero = () => 0.

let _ = {
  "value": (zero() :> t<[#Label]>),
}

Playground

(source_file [0, 0] - [7, 0]
  (type_declaration [0, 0] - [0, 18]
    (type_binding [0, 5] - [0, 18]
      name: (type_identifier [0, 5] - [0, 6])
      (type_parameters [0, 6] - [0, 10]
        (type_identifier [0, 7] - [0, 9]))
      (type_identifier [0, 13] - [0, 18])))
  (let_declaration [2, 0] - [2, 19]
    (let_binding [2, 4] - [2, 19]
      pattern: (value_identifier [2, 4] - [2, 8])
      body: (function [2, 11] - [2, 19]
        parameters: (formal_parameters [2, 11] - [2, 13])
        body: (number [2, 17] - [2, 19]))))
  (let_declaration [4, 0] - [6, 1]
    (let_binding [4, 4] - [6, 1]
      pattern: (value_identifier [4, 4] - [4, 5])
      body: (object [4, 8] - [6, 1]
        (field [5, 2] - [5, 34]
          (property_identifier [5, 2] - [5, 9]
            (string_fragment [5, 3] - [5, 8]))
          (parenthesized_expression [5, 11] - [5, 34]
            (binary_expression [5, 12] - [5, 33]
              left: (binary_expression [5, 12] - [5, 32]
                left: (coercion_expression [5, 12] - [5, 23]
                  left: (call_expression [5, 12] - [5, 18]
                    function: (value_identifier [5, 12] - [5, 16])
                    arguments: (arguments [5, 16] - [5, 18]))
                  right: (type_identifier [5, 22] - [5, 23]))
                right: (array [5, 24] - [5, 32]
                  (polyvar [5, 25] - [5, 31]
                    (polyvar_identifier [5, 25] - [5, 31]))))
              right: (value_identifier [5, 33] - [5, 33]))))))))
Test.res           0.36 ms         248 bytes/ms (MISSING "unpack" [5, 33] - [5, 33])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant