diff --git a/cli/src/format.rs b/cli/src/format.rs index 1d430c47d6..39cb2254fd 100644 --- a/cli/src/format.rs +++ b/cli/src/format.rs @@ -524,6 +524,7 @@ impl<'a> RemoveSpaces<'a> for Expr<'a> { Expr::PrecedenceConflict(a) => Expr::PrecedenceConflict(a), Expr::SpaceBefore(a, _) => a.remove_spaces(arena), Expr::SpaceAfter(a, _) => a.remove_spaces(arena), + Expr::SingleQuote(a) => Expr::Num(a), } } } @@ -565,6 +566,7 @@ impl<'a> RemoveSpaces<'a> for Pattern<'a> { } Pattern::SpaceBefore(a, _) => a.remove_spaces(arena), Pattern::SpaceAfter(a, _) => a.remove_spaces(arena), + Pattern::SingleQuote(a) => Pattern::NumLiteral(a), } } } diff --git a/compiler/mono/src/ir.rs b/compiler/mono/src/ir.rs index 36ce48a11b..d7400fc4bf 100644 --- a/compiler/mono/src/ir.rs +++ b/compiler/mono/src/ir.rs @@ -3039,7 +3039,7 @@ pub fn with_hole<'a>( SingleQuote(character) => Stmt::Let( assigned, Expr::Literal(Literal::Int(character as _)), - Layout::Builtin(Builtin::Int32), + Layout::int_width(IntWidth::I32), hole, ), @@ -7327,7 +7327,7 @@ fn from_can_pattern_help<'a>( } } StrLiteral(v) => Ok(Pattern::StrLiteral(v.clone())), - SingleQuote(c) => Ok(Pattern::IntLiteral(*c as _, IntPrecision::I32)), + SingleQuote(c) => Ok(Pattern::IntLiteral(*c as _, IntWidth::I32)), Shadowed(region, ident) => Err(RuntimeError::Shadowing { original_region: *region, shadow: ident.clone(), diff --git a/reporting/src/error/type.rs b/reporting/src/error/type.rs index 7e8adab72a..12ef801c8a 100644 --- a/reporting/src/error/type.rs +++ b/reporting/src/error/type.rs @@ -1054,19 +1054,6 @@ fn format_category<'b>( ]), alloc.text(" produces:"), ), - -<<<<<<< HEAD:compiler/reporting/src/error/type.rs - List => alloc.concat(vec![this_is, alloc.text(" a list of type:")]), - Num => alloc.concat(vec![this_is, alloc.text(" a number of type:")]), - Int => alloc.concat(vec![this_is, alloc.text(" an integer of type:")]), - Float => alloc.concat(vec![this_is, alloc.text(" a float of type:")]), - Str => alloc.concat(vec![this_is, alloc.text(" a string of type:")]), - StrInterpolation => alloc.concat(vec![ - this_is, - alloc.text(" a value in a string interpolation, which was of type:"), - ]), - Character => alloc.concat(vec![this_is, alloc.text(" a character of type:")]), -======= List => ( alloc.concat(vec![this_is, alloc.text(" a list")]), alloc.text(" of type:"), @@ -1094,18 +1081,19 @@ fn format_category<'b>( ]), alloc.text(" which was of type:"), ), ->>>>>>> trunk:reporting/src/error/type.rs - + Character => ( + alloc.concat(vec![this_is, alloc.text(" a character") + ]), + alloc.text(" of type:") + ), Lambda => ( alloc.concat(vec![this_is, alloc.text(" an anonymous function")]), alloc.text(" of type:"), ), - ClosureSize => ( alloc.concat(vec![this_is, alloc.text(" the closure size of a function")]), alloc.text(" of type:"), ), - TagApply { tag_name: TagName::Global(name), args_count: 0,