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 return value of typeinf_code for code == nothing #20068

Merged
merged 1 commit into from
Jan 20, 2017

Conversation

vchuravy
Copy link
Member

Fixes #20067

@SimonDanisch what was the example that triggered this? Would be good as a test case.

@tkelman tkelman added the needs tests Unit tests are required for this change label Jan 16, 2017
@SimonDanisch
Copy link
Contributor

that seems to do it:

@generated function construct_similar{FSA <: Tuple}(::Type{FSA}, elements::Tuple)
           :(FSA)
end
code_typed(construct_similar, (DataType, Tuple{Int, Int}))

@SimonDanisch
Copy link
Contributor

thanks! :)

@vchuravy vchuravy force-pushed the vc/fixup_typeinf_code branch from 6c96923 to d129379 Compare January 16, 2017 15:31
@vchuravy vchuravy removed the needs tests Unit tests are required for this change label Jan 16, 2017
@vchuravy vchuravy requested a review from vtjnash January 16, 2017 15:32
@vtjnash
Copy link
Member

vtjnash commented Jan 16, 2017

Is it possible to trigger this without DataType? That's a different error.

@kshyatt kshyatt added the compiler:inference Type inference label Jan 16, 2017
@vchuravy
Copy link
Member Author

I seem to be only able to trigger that code-path with DataType.

@vchuravy vchuravy force-pushed the vc/fixup_typeinf_code branch from d129379 to a9949be Compare January 19, 2017 14:21
@vchuravy
Copy link
Member Author

@vtjnash ok to merge?

@vtjnash vtjnash merged commit 79d564e into master Jan 20, 2017
@vtjnash vtjnash deleted the vc/fixup_typeinf_code branch January 20, 2017 05:02
@vtjnash vtjnash removed their request for review January 20, 2017 05:02
@generated function foo20067{T <: Tuple}(::Type{T}, elements::Tuple)
:(T)
end
code_typed(DevNull, foo20067, (DataType, Tuple{Int, Int}))
Copy link
Member

Choose a reason for hiding this comment

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

There is no 3-argument code_typed. Unfortunately this test failure was masked by #20027.
It would also be better if there were a @test in here.

Copy link
Member

Choose a reason for hiding this comment

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

Inference also fails here, I believe because it doesn't want to call the generated function on an abstract type (Type{T} where T<:Tuple).

Copy link
Member Author

@vchuravy vchuravy Jan 20, 2017

Choose a reason for hiding this comment

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

Sorry about that, I noticed that and then promptly forgot to fix it...
It might be best to remove the test for now. #20146

vchuravy added a commit that referenced this pull request Jan 20, 2017
JeffBezanson added a commit that referenced this pull request Jan 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:inference Type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants