Skip to content

Commit

Permalink
fix: make "foo#{}" work
Browse files Browse the repository at this point in the history
  • Loading branch information
mame committed Dec 20, 2024
1 parent 206e82a commit dbb3fe5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/typeprof/core/ast/value.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def self.create_part_node(raw_part, lenv)
when :string_node
AST.create_node(raw_part, lenv)
when :embedded_statements_node
AST.create_node(raw_part.statements, lenv)
raw_part.statements ? AST.create_node(raw_part.statements, lenv) : DummyNilNode.new(TypeProf::CodeRange.from_node(raw_part), lenv)
when :embedded_variable_node
AST.create_node(raw_part.variable, lenv)
else
Expand Down
10 changes: 10 additions & 0 deletions scenario/misc/dstr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ def bar: (Integer) -> String
def qux: (Float) -> String
end

## update
def foo
"foo#{ }"
end

## assert
class Object
def foo: -> String
end

## update
def xstring_lit(n)
`echo foo`
Expand Down

0 comments on commit dbb3fe5

Please sign in to comment.