JuliaLang / Compat.jl

Compatibility across Julia versions
Other
145 stars 117 forks source link

Required keyword arguments cannot have type assertions #635

Closed omus closed 4 years ago

omus commented 5 years ago

On Julia 0.6.4 with Compat 1.4.0

julia> using Compat

julia> @compat f(; x) = x
f (generic function with 1 method)

julia> f()
ERROR: UndefKeywordError: keyword argument x not assigned
Stacktrace:
 [1] f() at ./REPL[3]:1

julia> @compat g(; x::AbstractString) = x
ERROR: syntax: invalid keyword argument syntax "x::AbstractString" (expected assignment)

Required keyword support added in: https://github.com/JuliaLang/Compat.jl/pull/586

martinholters commented 4 years ago

Closing as outdated since we've dropped support for Julia prior to 1.0 and the offending code has been removed.