Skip to content

Conversation

@aviatesk
Copy link
Member

@aviatesk aviatesk commented Aug 27, 2021

I found we need to handle LimitedAccuracy (i.e. collect its
limitations into the current frame and unwrap its type) whenever
we do inter-procedural inference. Especially, we need to handle
it where we use abstract_call_method and abstract_call_method_with_const_args.
Otherwise we may encounter nested LimitedAccuracy, which is really not
expected to exist. So this commit also adds the assertion that checks we never
form nested LimitedAccuracy.

I encountered errors due to this when analyzing JET by JET itself,
probably because its codebase makes heavy use of invoke.
I couldn't pack them up as simple test cases though.

I found we need to handle `LimitedAccuracy` (i.e. collect its
limitations into the current frame and unwrap its type) whenever
we do inter-procedural inference. Especially, we need to handle
it where we use `abstract_call_method` and `abstract_call_method_with_const_args`.
Otherwise we may encounter nested `LimitedAccuracy`, which is really not
expected. So this commit also adds the assertion that checks we never
form nested `LimitedAccuracy`.

I encountered errors due to this when analyzing JET itself by JET,
probably because its codebase makes heavy use of `invoke`.
I couldn't pack them up as simple test cases though.
@aviatesk aviatesk requested a review from vtjnash August 27, 2021 17:27
@aviatesk aviatesk added the compiler:inference Type inference label Aug 27, 2021
@aviatesk
Copy link
Member Author

Should be backported to 1.7.

@aviatesk aviatesk merged commit 6341fa5 into master Aug 28, 2021
@aviatesk aviatesk deleted the avi/missinglimited branch August 28, 2021 05:33
aviatesk added a commit to aviatesk/JET.jl that referenced this pull request Aug 28, 2021
KristofferC pushed a commit that referenced this pull request Aug 31, 2021
I found we need to handle `LimitedAccuracy` (i.e. collect its
limitations into the current frame and unwrap its type) whenever
we do inter-procedural inference. Especially, we need to handle
it where we use `abstract_call_method` and `abstract_call_method_with_const_args`.
Otherwise we may encounter nested `LimitedAccuracy`, which is really not
expected. So this commit also adds the assertion that checks we never
form nested `LimitedAccuracy`.

I encountered errors due to this when analyzing JET itself by JET,
probably because its codebase makes heavy use of `invoke`.
I couldn't pack them up as simple test cases though.

(cherry picked from commit 6341fa5)
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
I found we need to handle `LimitedAccuracy` (i.e. collect its
limitations into the current frame and unwrap its type) whenever
we do inter-procedural inference. Especially, we need to handle
it where we use `abstract_call_method` and `abstract_call_method_with_const_args`.
Otherwise we may encounter nested `LimitedAccuracy`, which is really not
expected. So this commit also adds the assertion that checks we never
form nested `LimitedAccuracy`.

I encountered errors due to this when analyzing JET itself by JET,
probably because its codebase makes heavy use of `invoke`.
I couldn't pack them up as simple test cases though.
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
I found we need to handle `LimitedAccuracy` (i.e. collect its
limitations into the current frame and unwrap its type) whenever
we do inter-procedural inference. Especially, we need to handle
it where we use `abstract_call_method` and `abstract_call_method_with_const_args`.
Otherwise we may encounter nested `LimitedAccuracy`, which is really not
expected. So this commit also adds the assertion that checks we never
form nested `LimitedAccuracy`.

I encountered errors due to this when analyzing JET itself by JET,
probably because its codebase makes heavy use of `invoke`.
I couldn't pack them up as simple test cases though.
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.

4 participants