-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
False positive in type checking of refs to packages containing certain functions #1361
Labels
Comments
tsandall
added a commit
to tsandall/opa
that referenced
this issue
Apr 27, 2019
Given an = expression where both sides are unknown (e.g,. a = [1,x] where a is ??? and x is ???) the inferencing will produce any types for variables. However, there was a bug in the case that handles objects where any was not produced for object _keys_, only _values_. As a result, the object's type would remain partially unknown and the checker generated errors. This commit just corrects the inferencing to assign any to object keys when the other side of the = expression is of type any. Fixes open-policy-agent#1361 Signed-off-by: Torin Sandall <torinsandall@gmail.com>
tsandall
added a commit
that referenced
this issue
Apr 27, 2019
Given an = expression where both sides are unknown (e.g,. a = [1,x] where a is ??? and x is ???) the inferencing will produce any types for variables. However, there was a bug in the case that handles objects where any was not produced for object _keys_, only _values_. As a result, the object's type would remain partially unknown and the checker generated errors. This commit just corrects the inferencing to assign any to object keys when the other side of the = expression is of type any. Fixes #1361 Signed-off-by: Torin Sandall <torinsandall@gmail.com>
lphamilton
pushed a commit
to lphamilton/opa
that referenced
this issue
Apr 29, 2019
Given an = expression where both sides are unknown (e.g,. a = [1,x] where a is ??? and x is ???) the inferencing will produce any types for variables. However, there was a bug in the case that handles objects where any was not produced for object _keys_, only _values_. As a result, the object's type would remain partially unknown and the checker generated errors. This commit just corrects the inferencing to assign any to object keys when the other side of the = expression is of type any. Fixes open-policy-agent#1361 Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The type checker incorrectly generates errors when checking refs to packages containing functions that return objects constructed with variables as keys. For example:
Given this file, a reference to
data
ordata.pkg
will result in a type error:This looks like a bug in the type inference implementation because the function return type contains unknowns.
The text was updated successfully, but these errors were encountered: