8000 A tuple pattern with fewer names than the tuple has passes the checker · Issue #767 · kexhq/kex · GitHub
[go: up one dir, main page]

Skip to content
< 8000 link rel="modulepreload" href="https://github.githubassets.com/assets/9467-2def71322d9edcd1.js" crossorigin="anonymous" />

A tuple pattern with fewer names than the tuple has passes the checker #767

Open

Description

@akoskovacs

let (a, b) takes a three-element tuple apart with no error. The two backends then disagree.

main do
  let (a, b) = (1, 2, 3)
  IO.printLine(a)
  IO.printLine(b)
end
  • kex -C: No errors found.
  • kex -R: prints 1 and 2, dropping the third element.
  • kex (BEAM): Internal error: tuple.kex:4:15: runtime error: pattern mismatch — got (1, 2, 3)

Expected: a type error at the let, since (A, B) cannot match (Integer, Integer, Integer).

Seen on kex 0.4.0-rc.4 built from main at 371bbdf, and on 5773911. Found while writing explanations for oops.kex.run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0