Skip to content

Commit d31043e

Browse files
committed
output non-generic decls
1 parent 9f45d34 commit d31043e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/compiler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ mod tests {
138138

139139
compiler.parse(code.into(), &paths[0]);
140140
assert!(compiler.check());
141-
// compiler.specialize();
141+
compiler.specialize();
142142
assert!(compiler.decls.decls.len() > 0);
143143
compiler.run();
144144
}

src/monomorph_pass.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ impl MonomorphPass {
190190
// Create a specialized version and recursively process it
191191
self.instantiate_function(*fn_name, type_args, target_fdecl, decls)?;
192192
}
193+
} else {
194+
// Non-generic function, output as is.
195+
self.out_decls.push(decl.clone());
193196
}
194197
}
195198
}
@@ -779,7 +782,7 @@ mod tests {
779782
);
780783

781784
assert!(result.is_ok());
782-
assert_eq!(pass.out_decls.len(), 0);
785+
assert_eq!(pass.out_decls.len(), 1);
783786
}
784787

785788
#[test]

0 commit comments

Comments
 (0)