Skip to content

Commit 54c9234

Browse files
committed
chore: documentation
1 parent 87320df commit 54c9234

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • compiler/noirc_frontend/src/hir/type_check

compiler/noirc_frontend/src/hir/type_check/expr.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ impl<'interner> TypeChecker<'interner> {
154154
// Need to setup these flags here as `self` is borrowed mutably to type check the rest of the call expression
155155
// These flags are later used to type check calls to unconstrained functions from constrained functions
156156
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.
157159
self.errors.push(TypeCheckError::GlobalFunctionCall {
158160
span: self.interner.expr_span(expr_id),
159161
});

0 commit comments

Comments
 (0)