fix infinite recursion in dev rc generation

This commit is contained in:
Brendan Hansknecht 2024-07-15 09:04:50 -07:00
parent 0284248320
commit 507d339691
No known key found for this signature in database
GPG key ID: 0EA784685083E75B
3 changed files with 20 additions and 10 deletions

View file

@ -87,7 +87,7 @@ pub fn refcount_stmt<'a>(
ctx, ctx,
layout_interner, layout_interner,
layout, layout,
modify, &ModifyRc::Dec(*structure),
following, following,
) )
} }

View file

@ -3912,7 +3912,7 @@ fn list_range_length_overflow() {
); );
} }
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))] #[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
mod pattern_match { mod pattern_match {
#[allow(unused_imports)] #[allow(unused_imports)]
use crate::helpers::with_larger_debug_stack; use crate::helpers::with_larger_debug_stack;
@ -3926,7 +3926,7 @@ mod pattern_match {
#[cfg(feature = "gen-dev")] #[cfg(feature = "gen-dev")]
use crate::helpers::dev::assert_evals_to; use crate::helpers::dev::assert_evals_to;
use super::RocList; use super::{RocList, RocStr};
#[test] #[test]
fn unary_exact_size_match() { fn unary_exact_size_match() {
@ -4122,6 +4122,19 @@ mod pattern_match {
RocList<u8> RocList<u8>
) )
} }
#[test]
fn list_str() {
assert_evals_to!(
r#"
when ["d"] is
[alone] -> [alone]
other -> other
"#,
RocList::from_slice(&[RocStr::from("d")]),
RocList<RocStr>
)
}
} }
#[test] #[test]

View file

@ -89,13 +89,10 @@ pub fn helper(
// while you're working on the dev backend! // while you're working on the dev backend!
{ {
// println!("=========== Procedures =========="); // println!("=========== Procedures ==========");
// if pretty_print_ir_symbols() { // let pretty = pretty_print_ir_symbols();
// println!(""); // println!("");
// for proc in procedures.values() { // for proc in procedures.values() {
// println!("{}", proc.to_pretty(200)); // println!("{}", proc.to_pretty(&layout_interner, 200, pretty));
// }
// } else {
// println!("{:?}", procedures.values());
// } // }
// println!("=================================\n"); // println!("=================================\n");