Fix data-type reification from Void
This commit is contained in:
@@ -1486,6 +1486,16 @@ pub fn prelude_data_types(id_gen: &IdGenerator) -> IndexMap<DataTypeKey, TypedDa
|
||||
data_data_type,
|
||||
);
|
||||
|
||||
// Void
|
||||
let void_data_type = TypedDataType::void();
|
||||
data_types.insert(
|
||||
DataTypeKey {
|
||||
module_name: "".to_string(),
|
||||
defined_type: well_known::VOID.to_string(),
|
||||
},
|
||||
void_data_type,
|
||||
);
|
||||
|
||||
// Ordering
|
||||
let ordering_data_type = TypedDataType::ordering();
|
||||
data_types.insert(
|
||||
@@ -1569,6 +1579,10 @@ impl TypedDataType {
|
||||
DataType::known_enum(well_known::DATA, &[])
|
||||
}
|
||||
|
||||
pub fn void() -> Self {
|
||||
DataType::known_enum(well_known::VOID, well_known::VOID_CONSTRUCTORS)
|
||||
}
|
||||
|
||||
pub fn bool() -> Self {
|
||||
DataType::known_enum(well_known::BOOL, well_known::BOOL_CONSTRUCTORS)
|
||||
}
|
||||
|
||||
@@ -1233,7 +1233,8 @@ impl UntypedExpr {
|
||||
}
|
||||
|
||||
Err(format!(
|
||||
"invalid type annotation {tipo:?} for {ix}{} constructor with fields: {fields:?}",
|
||||
"invalid type annotation {tipo:?} for {}{} constructor with fields: {fields:?}",
|
||||
ix + 1,
|
||||
ordinal::Ordinal::<usize>(ix + 1).suffix(),
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user