mirror of
				https://gitea.invidious.io/iv-org/shard-ameba.git
				synced 2024-08-15 00:53:29 +00:00 
			
		
		
		
	Consider previous_def implicitly accessing variables, in the same way as super does
				
					
				
			This commit is contained in:
		
							parent
							
								
									b6f3d41211
								
							
						
					
					
						commit
						bb0c0eeec6
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -19,8 +19,8 @@ module Ameba::AST | |||
|       MacroFor, | ||||
|     } | ||||
| 
 | ||||
|     SUPER_NODE_NAME  = "super" | ||||
|     RECORD_NODE_NAME = "record" | ||||
|     SPECIAL_NODE_NAMES = %w[super previous_def] | ||||
|     RECORD_NODE_NAME   = "record" | ||||
| 
 | ||||
|     @scope_queue = [] of Scope | ||||
|     @current_scope : Scope | ||||
|  | @ -139,7 +139,7 @@ module Ameba::AST | |||
|     def visit(node : Crystal::Call) | ||||
|       case | ||||
|       when @current_scope.def? | ||||
|         if node.name == SUPER_NODE_NAME && node.args.empty? | ||||
|         if node.name.in?(SPECIAL_NODE_NAMES) && node.args.empty? | ||||
|           @current_scope.arguments.each do |arg| | ||||
|             variable = arg.variable | ||||
|             variable.reference(variable.node, @current_scope).explicit = false | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue