mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
fix debug asserts in dev backend
This commit is contained in:
parent
97aba2da41
commit
3364d03fcc
1 changed files with 30 additions and 41 deletions
|
@ -1068,13 +1068,12 @@ trait Backend<'a> {
|
||||||
}
|
}
|
||||||
LowLevel::Eq => {
|
LowLevel::Eq => {
|
||||||
debug_assert_eq!(2, args.len(), "Eq: expected to have exactly two argument");
|
debug_assert_eq!(2, args.len(), "Eq: expected to have exactly two argument");
|
||||||
debug_assert_eq!(
|
debug_assert!(
|
||||||
arg_layouts[0], arg_layouts[1],
|
self.interner().eq_repr(arg_layouts[0], arg_layouts[1],),
|
||||||
"Eq: expected all arguments of to have the same layout"
|
"Eq: expected all arguments of to have the same layout"
|
||||||
);
|
);
|
||||||
debug_assert_eq!(
|
debug_assert!(
|
||||||
Layout::BOOL,
|
self.interner().eq_repr(Layout::BOOL, *ret_layout,),
|
||||||
*ret_layout,
|
|
||||||
"Eq: expected to have return layout of type Bool"
|
"Eq: expected to have return layout of type Bool"
|
||||||
);
|
);
|
||||||
self.build_eq(sym, &args[0], &args[1], &arg_layouts[0])
|
self.build_eq(sym, &args[0], &args[1], &arg_layouts[0])
|
||||||
|
@ -1085,22 +1084,20 @@ trait Backend<'a> {
|
||||||
args.len(),
|
args.len(),
|
||||||
"NotEq: expected to have exactly two argument"
|
"NotEq: expected to have exactly two argument"
|
||||||
);
|
);
|
||||||
debug_assert_eq!(
|
debug_assert!(
|
||||||
arg_layouts[0], arg_layouts[1],
|
self.interner().eq_repr(arg_layouts[0], arg_layouts[1],),
|
||||||
"NotEq: expected all arguments of to have the same layout"
|
"NotEq: expected all arguments of to have the same layout"
|
||||||
);
|
);
|
||||||
debug_assert_eq!(
|
debug_assert!(
|
||||||
Layout::BOOL,
|
self.interner().eq_repr(Layout::BOOL, *ret_layout,),
|
||||||
*ret_layout,
|
|
||||||
"NotEq: expected to have return layout of type Bool"
|
"NotEq: expected to have return layout of type Bool"
|
||||||
);
|
);
|
||||||
self.build_neq(sym, &args[0], &args[1], &arg_layouts[0])
|
self.build_neq(sym, &args[0], &args[1], &arg_layouts[0])
|
||||||
}
|
}
|
||||||
LowLevel::Not => {
|
LowLevel::Not => {
|
||||||
debug_assert_eq!(1, args.len(), "Not: expected to have exactly one argument");
|
debug_assert_eq!(1, args.len(), "Not: expected to have exactly one argument");
|
||||||
debug_assert_eq!(
|
debug_assert!(
|
||||||
Layout::BOOL,
|
self.interner().eq_repr(Layout::BOOL, *ret_layout,),
|
||||||
*ret_layout,
|
|
||||||
"Not: expected to have return layout of type Bool"
|
"Not: expected to have return layout of type Bool"
|
||||||
);
|
);
|
||||||
self.build_not(sym, &args[0], &arg_layouts[0])
|
self.build_not(sym, &args[0], &arg_layouts[0])
|
||||||
|
@ -1111,13 +1108,12 @@ trait Backend<'a> {
|
||||||
args.len(),
|
args.len(),
|
||||||
"NumLt: expected to have exactly two argument"
|
"NumLt: expected to have exactly two argument"
|
||||||
);
|
);
|
||||||
debug_assert_eq!(
|
debug_assert!(
|
||||||
arg_layouts[0], arg_layouts[1],
|
self.interner().eq_repr(arg_layouts[0], arg_layouts[1],),
|
||||||
"NumLt: expected all arguments of to have the same layout"
|
"NumLt: expected all arguments of to have the same layout"
|
||||||
);
|
);
|
||||||
debug_assert_eq!(
|
debug_assert!(
|
||||||
Layout::BOOL,
|
self.interner().eq_repr(Layout::BOOL, *ret_layout,),
|
||||||
*ret_layout,
|
|
||||||
"NumLt: expected to have return layout of type Bool"
|
"NumLt: expected to have return layout of type Bool"
|
||||||
);
|
);
|
||||||
self.build_num_lt(sym, &args[0], &args[1], &arg_layouts[0])
|
self.build_num_lt(sym, &args[0], &args[1], &arg_layouts[0])
|
||||||
|
@ -1128,13 +1124,12 @@ trait Backend<'a> {
|
||||||
args.len(),
|
args.len(),
|
||||||
"NumGt: expected to have exactly two argument"
|
"NumGt: expected to have exactly two argument"
|
||||||
);
|
);
|
||||||
debug_assert_eq!(
|
debug_assert!(
|
||||||
arg_layouts[0], arg_layouts[1],
|
self.interner().eq_repr(arg_layouts[0], arg_layouts[1],),
|
||||||
"NumGt: expected all arguments of to have the same layout"
|
"NumGt: expected all arguments of to have the same layout"
|
||||||
);
|
);
|
||||||
debug_assert_eq!(
|
debug_assert!(
|
||||||
Layout::BOOL,
|
self.interner().eq_repr(Layout::BOOL, *ret_layout,),
|
||||||
*ret_layout,
|
|
||||||
"NumGt: expected to have return layout of type Bool"
|
"NumGt: expected to have return layout of type Bool"
|
||||||
);
|
);
|
||||||
self.build_num_gt(sym, &args[0], &args[1], &arg_layouts[0])
|
self.build_num_gt(sym, &args[0], &args[1], &arg_layouts[0])
|
||||||
|
@ -1159,9 +1154,8 @@ trait Backend<'a> {
|
||||||
"NumIsNan: expected to have exactly one argument"
|
"NumIsNan: expected to have exactly one argument"
|
||||||
);
|
);
|
||||||
|
|
||||||
debug_assert_eq!(
|
debug_assert!(
|
||||||
Layout::BOOL,
|
self.interner().eq_repr(Layout::BOOL, *ret_layout,),
|
||||||
*ret_layout,
|
|
||||||
"NumIsNan: expected to have return layout of type Bool"
|
"NumIsNan: expected to have return layout of type Bool"
|
||||||
);
|
);
|
||||||
self.build_num_is_nan(sym, &args[0], &arg_layouts[0])
|
self.build_num_is_nan(sym, &args[0], &arg_layouts[0])
|
||||||
|
@ -1173,9 +1167,8 @@ trait Backend<'a> {
|
||||||
"NumIsInfinite: expected to have exactly one argument"
|
"NumIsInfinite: expected to have exactly one argument"
|
||||||
);
|
);
|
||||||
|
|
||||||
debug_assert_eq!(
|
debug_assert!(
|
||||||
Layout::BOOL,
|
self.interner().eq_repr(Layout::BOOL, *ret_layout,),
|
||||||
*ret_layout,
|
|
||||||
"NumIsInfinite: expected to have return layout of type Bool"
|
"NumIsInfinite: expected to have return layout of type Bool"
|
||||||
);
|
);
|
||||||
self.build_num_is_infinite(sym, &args[0], &arg_layouts[0])
|
self.build_num_is_infinite(sym, &args[0], &arg_layouts[0])
|
||||||
|
@ -1187,9 +1180,8 @@ trait Backend<'a> {
|
||||||
"NumIsFinite: expected to have exactly one argument"
|
"NumIsFinite: expected to have exactly one argument"
|
||||||
);
|
);
|
||||||
|
|
||||||
debug_assert_eq!(
|
debug_assert!(
|
||||||
Layout::BOOL,
|
self.interner().eq_repr(Layout::BOOL, *ret_layout,),
|
||||||
*ret_layout,
|
|
||||||
"NumIsFinite: expected to have return layout of type Bool"
|
"NumIsFinite: expected to have return layout of type Bool"
|
||||||
);
|
);
|
||||||
self.build_num_is_finite(sym, &args[0], &arg_layouts[0])
|
self.build_num_is_finite(sym, &args[0], &arg_layouts[0])
|
||||||
|
@ -1204,9 +1196,8 @@ trait Backend<'a> {
|
||||||
arg_layouts[0], arg_layouts[1],
|
arg_layouts[0], arg_layouts[1],
|
||||||
"NumLte: expected all arguments of to have the same layout"
|
"NumLte: expected all arguments of to have the same layout"
|
||||||
);
|
);
|
||||||
debug_assert_eq!(
|
debug_assert!(
|
||||||
Layout::BOOL,
|
self.interner().eq_repr(Layout::BOOL, *ret_layout,),
|
||||||
*ret_layout,
|
|
||||||
"NumLte: expected to have return layout of type Bool"
|
"NumLte: expected to have return layout of type Bool"
|
||||||
);
|
);
|
||||||
self.build_num_lte(sym, &args[0], &args[1], &arg_layouts[0])
|
self.build_num_lte(sym, &args[0], &args[1], &arg_layouts[0])
|
||||||
|
@ -1221,9 +1212,8 @@ trait Backend<'a> {
|
||||||
arg_layouts[0], arg_layouts[1],
|
arg_layouts[0], arg_layouts[1],
|
||||||
"NumGte: expected all arguments of to have the same layout"
|
"NumGte: expected all arguments of to have the same layout"
|
||||||
);
|
);
|
||||||
debug_assert_eq!(
|
debug_assert!(
|
||||||
Layout::BOOL,
|
self.interner().eq_repr(Layout::BOOL, *ret_layout,),
|
||||||
*ret_layout,
|
|
||||||
"NumGte: expected to have return layout of type Bool"
|
"NumGte: expected to have return layout of type Bool"
|
||||||
);
|
);
|
||||||
self.build_num_gte(sym, &args[0], &args[1], &arg_layouts[0])
|
self.build_num_gte(sym, &args[0], &args[1], &arg_layouts[0])
|
||||||
|
@ -1761,9 +1751,8 @@ trait Backend<'a> {
|
||||||
args.len(),
|
args.len(),
|
||||||
"NumIsZero: expected to have exactly one argument"
|
"NumIsZero: expected to have exactly one argument"
|
||||||
);
|
);
|
||||||
debug_assert_eq!(
|
debug_assert!(
|
||||||
Layout::BOOL,
|
self.interner().eq_repr(Layout::BOOL, *ret_layout,),
|
||||||
*ret_layout,
|
|
||||||
"NumIsZero: expected to have return layout of type Bool"
|
"NumIsZero: expected to have return layout of type Bool"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue