mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Treat single quote literals as ranged numbers for inference purposes
This commit is contained in:
parent
797763b5fa
commit
178b634266
10 changed files with 179 additions and 16 deletions
|
@ -4027,12 +4027,18 @@ pub fn with_hole<'a>(
|
|||
hole,
|
||||
),
|
||||
|
||||
SingleQuote(character) => Stmt::Let(
|
||||
assigned,
|
||||
Expr::Literal(Literal::Int((character as i128).to_ne_bytes())),
|
||||
Layout::int_width(IntWidth::I32),
|
||||
hole,
|
||||
),
|
||||
SingleQuote(_, _, character, _) => {
|
||||
let layout = layout_cache
|
||||
.from_var(env.arena, variable, env.subs)
|
||||
.unwrap();
|
||||
|
||||
Stmt::Let(
|
||||
assigned,
|
||||
Expr::Literal(Literal::Int((character as i128).to_ne_bytes())),
|
||||
layout,
|
||||
hole,
|
||||
)
|
||||
}
|
||||
LetNonRec(def, cont) => from_can_let(
|
||||
env,
|
||||
procs,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue