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

BUG: mis-compilation of floating point literal patterns #4701

Open
crusso opened this issue Sep 17, 2024 · 0 comments
Open

BUG: mis-compilation of floating point literal patterns #4701

crusso opened this issue Sep 17, 2024 · 0 comments

Comments

@crusso
Copy link
Contributor

crusso commented Sep 17, 2024

Float point literal patterns are accepted by the type checker but not compiled correctly.

  • executed in the interpreter
  • non implemented in the compiler(s).

We should either rule them out or support them.

Repro:

https://m7sm4-2iaaa-aaaab-qabra-cai.raw.ic0.app/?tag=168118266

actor Echo {

  // Say the given phase.
  public query func check(number : Float) : async { #Zero; #NotZero } {
    switch (number) {
      case (0) #Zero;
      case (_) #NotZero;
    };
  };
};

Call check(0.0) produces Canister called ic0.trap with message: TODO: compile_lit_pat

Slack discussion:
https://dfinity.slack.com/archives/CPL67E7MX/p1726572384749519

@crusso crusso changed the title Bug: miscompilation of float point literal patterns BUG: mis-compilation of floating point literal patterns Sep 17, 2024
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