Skip to content

Commit a063bb3

Browse files
committed
Turn todo!("Structs") crash into compiler errors
1 parent d604cdd commit a063bb3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/flattening/typecheck/type_check.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,17 @@ impl<'l> TypeCheckingContext<'l> {
171171
.error(
172172
*name_span,
173173
format!(
174-
"The type of this object is a local interfaec '{}'. You cannot use struct fields on local interfaces",
174+
"The type of this object is a local interface '{}'. You cannot use struct fields on local interfaces",
175175
interface_decl.name
176176
),
177177
)
178178
.info_obj_same_file(interface_decl);
179179
self.type_checker.alloc_unknown()
180180
}
181-
AbstractInnerType::Named(_) => todo!("Structs"),
181+
AbstractInnerType::Named(_) => {
182+
self.errors.todo(*name_span, "Structs");
183+
self.type_checker.alloc_unknown() // todo!("Structs")
184+
}
182185
// TODO "subinterfaces"
183186
AbstractInnerType::Interface(md_ref, _interface) => {
184187
let md = self.globals.get_submodule(md_ref);

src/typing/value_unifier.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ impl Value {
236236
})
237237
}
238238
AbstractInnerType::Named(AbstractGlobalReference { .. }) => {
239-
todo!("Structs")
239+
return Err("TODO: Structs".to_string()); // todo!("Structs")
240240
}
241241
AbstractInnerType::Unknown(_) => unreachable!("Caught by typecheck"),
242242
AbstractInnerType::Interface(_, _) | AbstractInnerType::LocalInterface(_) => {

0 commit comments

Comments
 (0)