tonyhffong / Lint.jl

A lint tool for Julia code
Other
168 stars 33 forks source link

Support new where syntax #235

Open adamslc opened 7 years ago

adamslc commented 7 years ago

Lint does not seem to support the new where syntax. For example, this

struct Struct{T <: Real}
    a::Vector{T}
    b::Vector{T}

    function Struct(a::Vector{T}, b::Vector{T}) where {T <: Real}
        @assert length(a) == length(b)

        new{T}(a, b)
    end
end

produces the following lint output:

test.jl:2 E131 Struct(a::Vector{T}, b::Vector{T}): Lint does not understand argument #1
test.jl:2 E131 T <: Real: Lint does not understand argument #2
test.jl:6 E321 a: use of undeclared symbol
test.jl:6 E321 b: use of undeclared symbol
test.jl:8 E321 a: use of undeclared symbol
test.jl:8 E321 b: use of undeclared symbol
TotalVerb commented 7 years ago

Thanks for filing this issue! I intend to address this problem in the near future. There is an open #231 work in progress that lays the foundation for supporting this syntax.