Skip to content

An Array of an equality type stops both emitters with "an open Array element type" #1130

Closed

Description

@nicolas-abril

What you did

bend array_eq.bend -o x
bend array_eq.bend -o x.js

What happened

Error: an open Array element type

Both emitters stop here (lay_el wants a datatype element). The checker accepts the program: an equality is Data, so an Array of one is well-typed. The fuzzer reached it through a family whose arm is an equality, Array.new(F(0n), ..) with F(0n) = {0n == 0n : Nat}.

The file

import Base

def sz(p: Array<{0n == 0n : Nat}> & U32) -> U32:
  (a, n) = p
  n

def main() -> IO(Unit):
  do IO<Unit>:
    w : Unit <- IO.print(U32.show(sz(Array.size({0n == 0n : Nat}, Array.new({0n == 0n : Nat}, 2n, {==})))))
    IO.pure(Unit, Unit{})

bend --version

Bend 2.0.32 (main d2066a52); also on 2.0.31 (af569d48)

uname -sm

Darwin arm64

clang --version (the first line)

Apple clang version 17.0.0 (clang-1700.6.4.2)

Found by the bend2 differential fuzzer.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions