-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 IRAnything #56
Comments
schani
added a commit
that referenced
this issue
Aug 23, 2017
IRNothing means anything, so it can also be null. See #56
Merged
schani
added a commit
that referenced
this issue
Sep 10, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
IRAnything
currently serves two purposes in the IR:In inference, to signify a type we know nothing about. The only way for it to come about is as the element type of an empty array.
In generation, for any type, which we translate to
object
in C#.We make no explicit distinction between the two in the code, i.e. they are one and the same.
That mostly works for now, but we will run into trouble if our inference algorithm ever wants to distinguish between the two. In addition to that, JSON Schema does have a representation for "any type", but our unification algorithm does not treat
IRAnything
as "any type", so we can't use and expect to get correct results. For example, if we treat "any type" asIRAnything
, we would unify an array that contains one "any type" and one integer as an array containing integers. The correct unification is an array containing "any type".If we had
IRNoInformation
andIRAny
, unification would look like this:Of course, to preserve more type information we could still do
The text was updated successfully, but these errors were encountered: