diff --git a/TypedSyntax/src/node.jl b/TypedSyntax/src/node.jl index d464d34c..5202a855 100644 --- a/TypedSyntax/src/node.jl +++ b/TypedSyntax/src/node.jl @@ -142,6 +142,9 @@ function map_signature!(sig::TypedSyntaxNode, slotnames::Vector{Symbol}, slottyp if kind(arg) == K"curly" arg = first(children(arg)) end + if kind(arg) == K"var" + arg = child(arg, 1) + end kind(arg) == K"tuple" && return nothing, defaultval # FIXME? see extrema2 test @assert kind(arg) == K"Identifier" || is_operator(arg) return arg, defaultval diff --git a/TypedSyntax/test/runtests.jl b/TypedSyntax/test/runtests.jl index b1677ea9..eaace65b 100644 --- a/TypedSyntax/test/runtests.jl +++ b/TypedSyntax/test/runtests.jl @@ -687,6 +687,12 @@ include("test_module.jl") @test_nowarn str = sprint(tsn; context=:color=>false) do io, obj printstyled(io, obj; hide_type_stable=false) end + + # issue 597 + tsn = TypedSyntaxNode(TSN.f597, (Int,)) + @test_nowarn str = sprint(tsn; context=:color=>false) do io, obj + printstyled(io, obj; hide_type_stable=false) + end end if parse(Bool, get(ENV, "CI", "false")) diff --git a/TypedSyntax/test/test_module.jl b/TypedSyntax/test/test_module.jl index 64fe596a..30493f08 100644 --- a/TypedSyntax/test/test_module.jl +++ b/TypedSyntax/test/test_module.jl @@ -247,6 +247,8 @@ function obfuscated(x) return f(x) end +f597(var"#"::Int) = 1 + module Internal export helper helper(x) = x+1