File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 507507function refers_to_nonimported_type (arg:: EXPR )
508508 if hasref (arg) && refof (arg) isa Binding
509509 return true
510- elseif typof (arg) === CSTParser. UnaryOpCall && length (arg) == 2 && kindof (arg[1 ]) === CSTParser. Tokens. DECLARATION
510+ elseif typof (arg) === CSTParser. UnaryOpCall && length (arg) == 2 && ( kindof (arg[1 ]) === CSTParser. Tokens. DECLARATION || kindof (arg[ 1 ]) === CSTParser . Tokens . ISSUBTYPE)
511511 return refers_to_nonimported_type (arg[2 ])
512512 elseif _binary_assert (arg, CSTParser. Tokens. DECLARATION)
513513 return refers_to_nonimported_type (arg[3 ])
Original file line number Diff line number Diff line change 464464 StaticLint. check_for_pirates (cst[2 ])
465465 @test errorof (cst[2 ]) === nothing
466466 end
467+ let cst = parse_and_pass ("""
468+ import Base:sin
469+ abstract type T end
470+ sin(x::Array{T}) = 1
471+ sin(x::Array{<:T}) = 1
472+ sin(x::Array{Number}) = 1
473+ sin(x::Array{<:Number}) = 1
474+ """ )
475+ StaticLint. check_for_pirates (cst[3 ])
476+ StaticLint. check_for_pirates (cst[4 ])
477+ StaticLint. check_for_pirates (cst[5 ])
478+ StaticLint. check_for_pirates (cst[6 ])
479+ @test errorof (cst[3 ]) === nothing
480+ @test errorof (cst[4 ]) === nothing
481+ @test errorof (cst[5 ]) === StaticLint. TypePiracy
482+ @test errorof (cst[6 ]) === StaticLint. TypePiracy
483+ end
467484end
468485
469486@testset " docs for undescribed variables" begin
You can’t perform that action at this time.
0 commit comments