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

Non-Data List/Tuples lead to compiler crash #827

Closed
1 of 4 tasks
KtorZ opened this issue Feb 16, 2024 · 0 comments · Fixed by #869
Closed
1 of 4 tasks

Non-Data List/Tuples lead to compiler crash #827

KtorZ opened this issue Feb 16, 2024 · 0 comments · Fixed by #869
Assignees
Labels
bug Something isn't working typechecking Types and inference

Comments

@KtorZ
Copy link
Member

KtorZ commented Feb 16, 2024

What Git revision are you using?

v1.0.23-alpha+8584adc

What operating system are you using, and which version?

  • Linux / Ubuntu
  • Linux / Other
  • macOS
  • Windows

Describe what the problem is?

Encountered aiken::fatal::error

   crates/aiken-lang/src/gen_uplc.rs:1584:17

       internal error: entered unreachable code: We need a data type definition for type Fn {
       args: [
           App {
               public: true,
               module: "",
               name: "Int",
               args: [],
           },
       ],
       ret: App {
           public: true,
           module: "",
           name: "Int",
           args: [],
       },
   }

While building the following code:

type Foo =
  List<fn(Int) -> Int>

validator {
  fn spend(datum: Foo, redeemer: Data, context: Data) -> Bool {
    True
  }
}

A similar error occurs with tuples as well:

type Foo =
  (fn(Int) -> Int, ByteArray)

validator {
  fn spend(datum: Foo, redeemer: Data, context: Data) -> Bool {
    True
  }
}

What should be the expected behavior?

This should have been caught by the type-checker earlier as it isn't allowed to define a List/Tuples of non-Data entities to begin with. This shouldn't reach down to code-generation (so that it is properly unreachable).

@KtorZ KtorZ added bug Something isn't working typechecking Types and inference labels Feb 16, 2024
@rvcas rvcas self-assigned this Feb 16, 2024
@KtorZ KtorZ closed this as completed in #869 Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working typechecking Types and inference
Projects
Status: 🚀 Released
Development

Successfully merging a pull request may close this issue.

2 participants