@@ -419,7 +419,8 @@ def evaluate_constant_path_or_write_node(node, scope)
419419 def evaluate_constant_path_write_node ( node , scope )
420420 receiver = evaluate node . target . parent , scope if node . target . parent
421421 value = evaluate node . value , scope
422- const_path_write receiver , node . target . child . name . to_s , value , scope
422+ name = node . target . respond_to? ( :name ) ? node . target . name . to_s : node . target . child . name . to_s
423+ const_path_write receiver , name , value , scope
423424 value
424425 end
425426
@@ -871,7 +872,7 @@ def assign_required_parameter(node, value, scope)
871872 def evaluate_constant_node_info ( node , scope )
872873 case node
873874 when Prism ::ConstantPathNode
874- name = node . child . name . to_s
875+ name = node . respond_to? ( :name ) ? node . name . to_s : node . child . name . to_s
875876 if node . parent
876877 receiver = evaluate node . parent , scope
877878 if receiver . is_a? Types ::SingletonType
@@ -1042,7 +1043,8 @@ def evaluate_write(node, value, scope, evaluated_receivers)
10421043 scope [ node . name . to_s ] = value
10431044 when Prism ::ConstantPathTargetNode
10441045 receiver = evaluated_receivers &.[]( node . parent ) || evaluate ( node . parent , scope ) if node . parent
1045- const_path_write receiver , node . child . name . to_s , value , scope
1046+ name = node . respond_to? ( :name ) ? node . name . to_s : node . child . name . to_s
1047+ const_path_write receiver , name , value , scope
10461048 end
10471049 end
10481050
0 commit comments