You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempted to debug a Noir program by adding invalid variables to the body of a default method:
traitFoo {
pubfnfoo(self, x: Field) {
InvalidTypeName::invalid_method_name();
x.other_invalid_method_name();
invalid_function_name();
let_: [InvalidTypeName; InvalidGeneric] = self.invalid_self_method_name();
invalid_variable_name
}
// The expected error occurs when either a parameter or the return type is unknown:// error: Could not resolve 'InvalidTypeName' in path// pub fn bar(self) -> InvalidTypeName { }// pub fn bar(self, x: InvalidTypeName) { }
}
// The expected error occurs when implementing 'Foo':// error: Could not resolve 'invalid_method_name' in path// impl Foo for () {}fnmain() { }
Expected Behavior
Expected error: Could not resolve 'invalid_method_name' in path and/or similar errors for:
other_invalid_method_name
invalid_function_name
InvalidTypeName
InvalidGeneric
invalid_self_method_name
invalid_variable_name
Bug
Invalid paths in default trait methods should error. E.g. for the Rust program:
error[E0433]: failed to resolve: use of undeclared type`InvalidTypeName`
--> src/main.rs:4:9
|
4 |InvalidTypeName::invalid_method_name();
| ^^^^^^^^^^^^^^^ use of undeclared type`InvalidTypeName`
To Reproduce
Workaround
Yes
Workaround Description
To get the type-checker to run on trait default methods, add an impl for any trait that has default methods, even if its non-default methods are defined to be panic.
Additional Context
No response
Project Impact
None
Blocker Context
No response
Nargo Version
nargo version = 0.38.0 noirc version = 0.38.0+0fc0c53ec183890370c69aa4148952b3123cb055 (git version hash: 0fc0c53, is dirty: false)
NoirJS Version
No response
Proving Backend Tooling & Version
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered:
Aim
Attempted to debug a Noir program by adding invalid variables to the body of a default method:
Expected Behavior
Expected
error: Could not resolve 'invalid_method_name' in path
and/or similar errors for:other_invalid_method_name
invalid_function_name
InvalidTypeName
InvalidGeneric
invalid_self_method_name
invalid_variable_name
Bug
Invalid paths in default trait methods should error. E.g. for the Rust program:
Rust returns the error:
To Reproduce
Workaround
Yes
Workaround Description
To get the type-checker to run on trait default methods, add an
impl
for any trait that has default methods, even if its non-default methods are defined to bepanic
.Additional Context
No response
Project Impact
None
Blocker Context
No response
Nargo Version
nargo version = 0.38.0 noirc version = 0.38.0+0fc0c53ec183890370c69aa4148952b3123cb055 (git version hash: 0fc0c53, is dirty: false)
NoirJS Version
No response
Proving Backend Tooling & Version
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: