Describe the problem
One cannot use the @NamedTuple syntax (introduced in julia 1.5) inside a @resumable function, if one of the keys of the named tuple is also present as a local variable of that function.
I expect the @NamedTuple{foo::Int64} syntax in the mwe below to be equivalent to replacing it by Base.NamedTuple{(:foo,), Base.Tuple{Int64}}. However, the latter works as expected, but the former throws ERROR: syntax: invalid named tuple field name "_fsmi.foo" around REPL[26]:2.
Minimal Working Example
@resumable function bar()
vec = (foo = 3,)::@NamedTuple{foo::Int64}
foo = "unused"
@yield vec
end
@resumable function bar2()
vec = @NamedTuple{foo::Int64}((foo = 3,))
foo = "unused"
@yield vec
end
Package versions
Please provide the versions you use. To do this, run the code:
julia> Pkg.status(["ResumableFunctions"]; mode = PKGMODE_MANIFEST)
Status `/tmp/jl_MokoyF/Manifest.toml`
[c5292f4c] ResumableFunctions v0.6.10
Describe the problem
One cannot use the
@NamedTuplesyntax (introduced in julia 1.5) inside a@resumablefunction, if one of the keys of the named tuple is also present as a local variable of that function.I expect the
@NamedTuple{foo::Int64}syntax in the mwe below to be equivalent to replacing it byBase.NamedTuple{(:foo,), Base.Tuple{Int64}}. However, the latter works as expected, but the former throwsERROR: syntax: invalid named tuple field name "_fsmi.foo" around REPL[26]:2.Minimal Working Example
Package versions
Please provide the versions you use. To do this, run the code: