Skip to content

Fix type unification for type parameters - #1479

Open
l46kok wants to merge 3 commits into
cel-expr:masterfrom
l46kok:type-assignability-fix
Open

Fix type unification for type parameters#1479
l46kok wants to merge 3 commits into
cel-expr:masterfrom
l46kok:type-assignability-fix

Conversation

@l46kok

@l46kok l46kok commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Comment thread checker/types.go
Comment thread checker/types.go
// or conform to an existing binding in 'm'. Returns false on structural/kind mismatches
// (e.g., int vs list(T)), occurs-check cycles, or conflicting type param bindings.
if hasTypeParam(fromType) || hasTypeParam(toType) {
return internalIsAssignable(m, fromType, toType)

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.

I think there might be some issue with the occurs check with inputs like:

type(map(string, T)), type(T)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We should be ok, the type substitution check propagates for map parameters. I've added some tests around this just to be sure.

@l46kok
l46kok marked this pull request as ready for review September 10, 2026 22:02
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.

2 participants