Closed simeonschaub closed 3 years ago
Hmm, ok, I am now not quite sure how FakeTypeName
is supposed to work. Is it expected that something like Array{Int}
just drops the parameters for the DataType
Array{Int,TypeName(:N)}
completely? It seems to be intentional because FakeTypeName
is called with justname=true
.
Bump. What should be done about the tests here?
bump, would love to be able to use this on 1.7
Hmm, ok, I am now not quite sure how
FakeTypeName
is supposed to work. Is it expected that something likeArray{Int}
just drops the parameters for theDataType
Array{Int,TypeName(:N)}
completely? It seems to be intentional becauseFakeTypeName
is called withjustname=true
.
Yes, in it's current state this isn't intended to fully describe the types. Parameters are dropped except where at the first level of a DataType. For example given abstract type T{S} end
we would have a full representaiton of T{Bool}
but not of T{T{Bool}}
and so FakeTypeName(T{T{SomeType}}) == FakeTypeName(T{T{SomeOtherType}})
is expected. This is to prevent storing 'massive' datatypes - there are some huge ones in LinearAlgebra. Given this, I don't think the tests are quite appropriate (i.e. they're asking too much) and happy for them to be dropped.
I've not had a look at the new approach to Varargs and a different heuristic may well be appropriate.
I still kept most of the tests, but excluded some in earlier Julia versions. I hope they are not too strict now, but my thought was that they can always be loosened if they become a problem. This also now passes on justname=true
for all type parameters of Vararg
to be consistent with the previous behavior.
This is to prevent storing 'massive' datatypes - there are some huge ones in LinearAlgebra.
Do you mean things like StridedArray
? Maybe we could piggyback off the type alias printing added to Base in https://github.com/JuliaLang/julia/pull/36107 here, so we only store the alias if there is a matching one.
Thanks, looks good. Yes exactly that, I'll have a look at the PR (thanks for the ref).
Good to merge?
Would also be great to have a tag with the fix.
Yes, staticlint will need small adjustments.
see https://github.com/JuliaLang/julia/pull/38835 and https://github.com/JuliaLang/julia/pull/38136