We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87320df commit 54c9234Copy full SHA for 54c9234
1 file changed
compiler/noirc_frontend/src/hir/type_check/expr.rs
@@ -154,6 +154,8 @@ impl<'interner> TypeChecker<'interner> {
154
// Need to setup these flags here as `self` is borrowed mutably to type check the rest of the call expression
155
// These flags are later used to type check calls to unconstrained functions from constrained functions
156
let Some(current_func) = self.current_function else {
157
+ // If we don't have a value for `current_function` then we are initializing a global.
158
+ // We disallow these from being assigned from a function call.
159
self.errors.push(TypeCheckError::GlobalFunctionCall {
160
span: self.interner.expr_span(expr_id),
161
});
0 commit comments