Skip to content

Commit 58f9f6d

Browse files
committed
Replace ValueType::Any with VarType::Var.
1 parent 3f9d5bd commit 58f9f6d

File tree

4 files changed

+312
-145
lines changed

4 files changed

+312
-145
lines changed

src/codegen/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ impl Codegen {
128128
let inner = self.lift_type(t.as_ref());
129129
CompType::Vec(Box::new(inner)).into()
130130
}
131-
ValueType::Any => panic!("ValueType::Any"),
132131
ValueType::Record(fields) => {
133132
let mut rt_fields = Vec::new();
134133
for (lab, ty) in fields.iter() {

src/codegen/rust_ast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ impl TryFrom<ValueType> for RustType {
667667
let inner = Self::try_from(t.as_ref().clone())?;
668668
Ok(CompType::<Box<RustType>>::Vec(Box::new(inner)).into())
669669
}
670-
ValueType::Any | ValueType::Record(..) | ValueType::Union(..) => Err(value),
670+
ValueType::Record(..) | ValueType::Union(..) => Err(value),
671671
}
672672
}
673673
}

src/decoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ impl<'a> Compiler<'a> {
516516
let mut compiler = Compiler::new(module);
517517
// type
518518
let scope = TypeScope::new();
519-
let t = module.infer_format_type(&scope, format)?;
519+
let t = module.infer_format_type(&scope, format)?.to_value_type();
520520
// decoder
521521
compiler.queue_compile(t, format, Rc::new(Next::Empty));
522522
while let Some((f, next, n)) = compiler.compile_queue.pop() {

0 commit comments

Comments
 (0)