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

fix on Julia nightly #194

Merged
merged 6 commits into from
Jan 5, 2021
Merged

Conversation

simeonschaub
Copy link
Contributor

pfitzseb
pfitzseb previously approved these changes Dec 17, 2020
Copy link
Member

@pfitzseb pfitzseb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but @ZacLN should probably take a look at this too.

@simeonschaub
Copy link
Contributor Author

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.

ZacLN
ZacLN previously approved these changes Dec 19, 2020
@simeonschaub
Copy link
Contributor Author

Bump. What should be done about the tests here?

src/faketypes.jl Outdated Show resolved Hide resolved
@musm
Copy link

musm commented Dec 31, 2020

bump, would love to be able to use this on 1.7

@ZacLN
Copy link
Contributor

ZacLN commented Dec 31, 2020

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.

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.

@simeonschaub
Copy link
Contributor Author

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 JuliaLang/julia#36107 here, so we only store the alias if there is a matching one.

@ZacLN
Copy link
Contributor

ZacLN commented Dec 31, 2020

Thanks, looks good. Yes exactly that, I'll have a look at the PR (thanks for the ref).

@simeonschaub
Copy link
Contributor Author

Good to merge?

@musm
Copy link

musm commented Jan 5, 2021

Would also be great to have a tag with the fix.

@pfitzseb pfitzseb merged commit a31d2b4 into julia-vscode:master Jan 5, 2021
@ZacLN
Copy link
Contributor

ZacLN commented Jan 5, 2021

Yes, staticlint will need small adjustments.

@simeonschaub simeonschaub deleted the sds/fixnightly branch January 5, 2021 12:14
simeonschaub added a commit to simeonschaub/StaticLint.jl that referenced this pull request Jan 5, 2021
simeonschaub added a commit to simeonschaub/StaticLint.jl that referenced this pull request Jan 5, 2021
@@ -10,7 +10,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: ['1.0', '1.1', '1.2', '1.3', '1.4', '1.5']
julia-version: ['1.0', '1.1', '1.2', '1.3', '1.4', '1.5', 'nightly']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should generally not edit these files manually, they are managed by package butler and any change we make manually here will be undone by package butler down the road.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, sorry! Didn't realize they were automatically generated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No harm done, it will just disappear at some point again :)

simeonschaub added a commit to simeonschaub/StaticLint.jl that referenced this pull request Jan 5, 2021
davidanthoff added a commit to julia-vscode/StaticLint.jl that referenced this pull request Jan 5, 2021
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 this pull request may close these issues.

5 participants