mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
Get it all to compile!
This commit is contained in:
parent
555478cdf0
commit
8272ea876f
21 changed files with 217 additions and 21 deletions
|
@ -1676,7 +1676,11 @@ fn pattern_to_when<'a>(
|
|||
(symbol, Located::at_zero(wrapped_body))
|
||||
}
|
||||
|
||||
IntLiteral(_, _, _) | NumLiteral(_, _, _) | FloatLiteral(_, _, _) | StrLiteral(_) => {
|
||||
IntLiteral(_, _, _)
|
||||
| NumLiteral(_, _, _)
|
||||
| FloatLiteral(_, _, _)
|
||||
| StrLiteral(_)
|
||||
| roc_can::pattern::Pattern::SingleQuote(_) => {
|
||||
// These patters are refutable, and thus should never occur outside a `when` expression
|
||||
// They should have been replaced with `UnsupportedPattern` during canonicalization
|
||||
unreachable!("refutable pattern {:?} where irrefutable pattern is expected. This should never happen!", pattern.value)
|
||||
|
@ -2837,6 +2841,13 @@ pub fn with_hole<'a>(
|
|||
hole,
|
||||
),
|
||||
|
||||
SingleQuote(character) => Stmt::Let(
|
||||
assigned,
|
||||
Expr::Literal(Literal::Int(character as _)),
|
||||
Layout::Builtin(Builtin::Int32),
|
||||
hole,
|
||||
),
|
||||
|
||||
Num(var, num_str, num) => {
|
||||
// first figure out what kind of number this is
|
||||
match num_argument_to_int_or_float(env.subs, env.ptr_bytes, var, false) {
|
||||
|
@ -7025,6 +7036,7 @@ fn from_can_pattern_help<'a>(
|
|||
}
|
||||
}
|
||||
StrLiteral(v) => Ok(Pattern::StrLiteral(v.clone())),
|
||||
SingleQuote(c) => Ok(Pattern::IntLiteral(*c as _, IntPrecision::I32)),
|
||||
Shadowed(region, ident) => Err(RuntimeError::Shadowing {
|
||||
original_region: *region,
|
||||
shadow: ident.clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue