Skip to content

Updates to type unification with parameterized types#1385

Open
TristonianJones wants to merge 1 commit into
cel-expr:masterfrom
TristonianJones:type-check-unify-fix
Open

Updates to type unification with parameterized types#1385
TristonianJones wants to merge 1 commit into
cel-expr:masterfrom
TristonianJones:type-check-unify-fix

Conversation

@TristonianJones

Copy link
Copy Markdown
Collaborator

Addresses type unification issues identified in conformance tests.

Closes #1312

Comment thread checker/checker_test.go
outType: types.NewListType(types.NewNullableType(types.IntType)),
},
{
in: `[1, null]`,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

These are a bit interesting, do you think we should automatically promote to a union type based on component elements, or require that one of the elements already inferred to be a union? (maybe less interesting for just nullables right now, but becomes more interesting if we add a JSON value type union or something like any of from JSON schema and have to decide if we keep a set of type union candidates or allow arbitrary ones).

Comment thread checker/checker_test.go
outType: types.NewListType(types.NewNullableType(types.IntType)),
},
{
in: `[null_int, null, 1]`,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

May want an explicit test to check that different nullables don't coalesce [m.string_wrapper, null, m.int64_wrapper] -> list(dyn)

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.

Compiler type-checking failure with empty list variables

2 participants