We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4dfd6be commit 7c1564aCopy full SHA for 7c1564a
src/resolve/type_definition/resolve.rs
@@ -123,10 +123,11 @@ fn resolve_structure(
123
let mut ok = Ok(());
124
ty.kind.for_each_polymorph(&mut |name| {
125
if structure.params.params.keys().filter(|n| *n == name).next().is_none() {
126
- ok = Err(ResolveError::other(format!("Cannot use polymorph '${}' inside type that is not declared by enclosing structure", name), ty.source));
+ if ok.is_ok() {
127
+ ok = Err(ResolveError::other(format!("Cannot use polymorph '${}' inside type that is not declared by enclosing structure", name), ty.source));
128
+ }
129
}
130
});
-
131
ok?;
132
133
let resolved_struct = asg.structs.get_mut(struct_ref).expect("valid struct");
0 commit comments