File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -515,9 +515,14 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_null_or_alternative(AST::ImmediateEx
515
515
return nullptr ;
516
516
}
517
517
518
- auto value = TRY (TRY (const_cast <AST::Node&>(*arguments.first ()).run (*this ))->resolve_without_cast (*this ));
518
+ auto name = TRY (TRY (const_cast <AST::Node&>(*arguments.first ()).run (*this ))->resolve_as_string (*this ));
519
+ auto frame = find_frame_containing_local_variable (name);
520
+ if (!frame)
521
+ return make_ref_counted<AST::StringLiteral>(invoking_node.position (), " " _short_string, AST::StringLiteral::EnclosureType::None);
522
+
523
+ auto value = frame->local_variables .get (name.bytes_as_string_view ()).value ();
519
524
if ((value->is_string () && TRY (value->resolve_as_string (*this )).is_empty ()) || (value->is_list () && TRY (value->resolve_as_list (*this )).is_empty ()))
520
- return make_ref_counted<AST::SyntheticNode>(invoking_node.position (), value);
525
+ return make_ref_counted<AST::SyntheticNode>(invoking_node.position (), * value);
521
526
522
527
return arguments.last ();
523
528
}
You can’t perform that action at this time.
0 commit comments