Skip to content

type checker: identify compatible type from reference#8485

Open
sspaink wants to merge 4 commits intoopen-policy-agent:mainfrom
sspaink:fixtypecheckinginference
Open

type checker: identify compatible type from reference#8485
sspaink wants to merge 4 commits intoopen-policy-agent:mainfrom
sspaink:fixtypecheckinginference

Conversation

@sspaink
Copy link
Copy Markdown
Member

@sspaink sspaink commented Apr 3, 2026

resolve: #7273

Better solution then the one I was attempting here: #7273 (comment). My original approach was to refactor unify1 to infer types conditionally and that just made the problem bigger than it had to be.

This approach adding an extra check using the existing unifies to catch compatibility when the type is known is straightforward way to handle this. unify1 does also check for compatibility but because of the infer type functionality it was overwriting the reference incorrectly.

One of the big hurdles I had was trying to understand what unify1 and unifies were doing, hopefully the added comments will make that easier the next time someone looks at this.

The update to unifiesObjectsStatic also resolves this issue: #6751, test case added

Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 3, 2026

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit 04d88b7
🔍 Latest deploy log https://app.netlify.com/projects/openpolicyagent/deploys/69d41c7d12fc710008e00991
😎 Deploy Preview https://deploy-preview-8485--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

sspaink added 3 commits April 3, 2026 12:00
…ies to be optional, similar to unify1Object

Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
consolidate tests

Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
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.

Type checker fails to identify type from reference

1 participant