Fix data-type reification from Void
This commit is contained in:
parent
523b270a8f
commit
4b95db4f88
14
CHANGELOG.md
14
CHANGELOG.md
|
@ -1,5 +1,19 @@
|
|||
# Changelog
|
||||
|
||||
## v1.1.5 - UNRELEASED
|
||||
|
||||
### Added
|
||||
|
||||
- N/A
|
||||
|
||||
### Changed
|
||||
|
||||
- **aiken-lang**: Fix data-type reification from `Void`; somehow missing from known definition :facepalm:. @KtorZ
|
||||
|
||||
### Removed
|
||||
|
||||
- N/A
|
||||
|
||||
## v1.1.4 - 2024-10-01
|
||||
|
||||
### Added
|
||||
|
|
|
@ -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(),
|
||||
))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue