Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type assertion and default seem inconsistent #122

Closed
omus opened this issue Feb 19, 2016 · 2 comments · Fixed by #179
Closed

Type assertion and default seem inconsistent #122

omus opened this issue Feb 19, 2016 · 2 comments · Fixed by #179

Comments

@omus
Copy link

omus commented Feb 19, 2016

I believe the linter may not be interpreting parametric functions correctly:

julia> using Lint

julia> lintstr("foo{S<:AbstractString}(args::Array{S}=ARGS) = typeof(args)")
1-element Array{Lint.LintMessage,1}:
 none:1 [foo            ] ERROR  args type assertion and default seem inconsistent

ARGS is of the type Array{UTF8String,1} which definitely matches the type assertion.

@tonyhffong
Copy link
Owner

Hm... but this returns false:

Array{UTF8String,1} <: Array{AbstractString}

@TotalVerb
Copy link
Collaborator

@tonyhffong But this returns true:

julia> S = TypeVar(:S, AbstractString)
S<:AbstractString

julia> Array{UTF8String,1} <: Array{S}
true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants