Skip to content

Backport #657 to release-0-22#678

Merged
zhenrongliew merged 1 commit into
release-0-22from
dl/backport-657-to-release-0-22
Jun 26, 2026
Merged

Backport #657 to release-0-22#678
zhenrongliew merged 1 commit into
release-0-22from
dl/backport-657-to-release-0-22

Conversation

@zhenrongliew

Copy link
Copy Markdown
Collaborator

Backports #657 onto the 0.22 release line.

This cherry-picks the FunctionType TypeVar subset fix from main into release-0-22 so it can be included in the next 0.22 patch release.

Validation:

  • uv run pytest test/lowering/test_657.py

…e it will be compabitle with generics (#657)

Related issue #656 The problem there is when the FunctionType interaces
with the IList Generic type it exposed that we're missing a visitor for
`is_subseteq_TypeVar` because during lowering we haven't inferred the
type yet.

(cherry picked from commit 54ea95c)
@github-actions

Copy link
Copy Markdown
Contributor

☂️ Code Coverage

current status: ✅

Overall Coverage

Statements Covered Coverage Threshold Status
11503 10354 90% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
src/kirin/ir/attrs/types.py 87% 🟢
TOTAL 87% 🟢

updated for commit: ddbaa9c by action🐍

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-26 14:58 UTC

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR backports the fix from #657 onto release-0-22, addressing a missing TypeVar subset check for FunctionType during lowering/type inference so FunctionType can interoperate correctly with generic types (e.g., ilist.IList).

Changes:

  • Add FunctionType.is_subseteq_TypeVar() to delegate subset checks to the TypeVar bound.
  • Add a regression test that exercises a list/IList of @basic methods to ensure lowering/type inference completes and runtime behavior matches expectations.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/kirin/ir/attrs/types.py Adds FunctionType.is_subseteq_TypeVar so FunctionType <= TypeVar is evaluated via the TypeVar’s bound.
test/lowering/test_657.py Regression test covering the reported lowering/type-inference failure path involving FunctionType and ilist.IList generics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@weinbe58 weinbe58 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM thanks

@zhenrongliew zhenrongliew merged commit 2a4c99b into release-0-22 Jun 26, 2026
13 of 14 checks passed
@zhenrongliew zhenrongliew deleted the dl/backport-657-to-release-0-22 branch June 26, 2026 14:57
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.

3 participants