@@ -72,11 +72,12 @@ impl Compiler {
7272 _ => None ,
7373 } ) {
7474 if let Ok ( Some ( ( path_locals, local) ) ) = self . ref_local ( r) {
75- let is_noadic_function = match & self . asm . bindings [ local. index ] . kind {
76- BindingKind :: Func ( f) if f. sig . args ( ) == 0 => true ,
77- _ => false ,
75+ let allow_alias = match & self . asm . bindings [ local. index ] . kind {
76+ BindingKind :: Func ( f) if f. sig . args ( ) == 0 => false ,
77+ BindingKind :: Scope ( _) => false ,
78+ _ => true ,
7879 } ;
79- if !is_noadic_function {
80+ if allow_alias {
8081 self . validate_local ( & r. name . value , local, & r. name . span ) ;
8182 ( self . code_meta . global_references )
8283 . insert ( binding. name . span . clone ( ) , local. index ) ;
@@ -303,13 +304,13 @@ impl Compiler {
303304 let in_function = self
304305 . scopes ( )
305306 . any ( |sc| matches ! ( sc. kind, ScopeKind :: Function ) ) ;
307+ let no_code_words = binding. words . iter ( ) . all ( |w| !w. value . is_code ( ) ) ;
306308 self . current_bindings . push ( CurrentBinding {
307309 name : name. clone ( ) ,
308310 signature : binding. signature . as_ref ( ) . map ( |s| s. value ) ,
309311 recurses : 0 ,
310312 global_index : local. index ,
311313 } ) ;
312- let no_code_words = binding. words . iter ( ) . all ( |w| !w. value . is_code ( ) ) ;
313314
314315 // Compile the words
315316 let ( _, mut node) = self . in_scope ( ScopeKind :: Binding , |comp| {
@@ -514,6 +515,7 @@ impl Compiler {
514515 }
515516 ModuleKind :: Test => ( ScopeKind :: Test , None ) ,
516517 } ;
518+ // Compile items
517519 let ( module, ( ) ) = self . in_scope ( scope_kind, |comp| {
518520 comp. items ( m. items , ItemCompMode :: TopLevel ) ?;
519521 comp. end_enum ( ) ?;
0 commit comments