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
Float point literal patterns are accepted by the type checker but not compiled correctly.
We should either rule them out or support them.
Repro:
https://m7sm4-2iaaa-aaaab-qabra-cai.raw.ic0.app/?tag=168118266
Call check(0.0) produces Canister called
ic0.trap
with message: TODO: compile_lit_patSlack discussion: https://dfinity.slack.com/archives/CPL67E7MX/p1726572384749519