已合并
fix: fold is_subtype #613
fix: fold is_subtype #613
已合并
yanjs创建于 8月31日
yanjs
yanjs仓颉Developer
8月31日

Change Details (Required)

问题出现在目前我们在去虚化pass消除isSubType的时候,通过extensiondef 判断两个interface的继承关系。

当出现where语句的时候,例如issue中用例:

interface I1 {}

interface I2 {}

interface I3 {}

interface I4 {}

interface I5 {}

open class CBase {}

class CA <: CBase & I1 {}

extend CA <: I5 where T <: I4 {}

extend CA <: I4 {}

extend CA <: I2 {}

extend CBase <: I3 where T <: I3 {}

extend Float64 <: I3 {}

extend Bool <: I4 {}

func test() {
if (CA() is I5) {
println("CA is I5")
}
}

main() {
let x: CA = CA()
if (x is I5) {
println("x is I5")
}
0
}

会生成extension def,但是实际是否继承需要去判断extension def中的where condition。

Change Type (Required)

Please describe the type of changes in this Pull Request (reason). Simply save and click the checkbox, or when editing, change [ ] to [x] for the relevant item.

Self-Check of Changes (Required)

Please do not modify or delete the following options. Simply save and click the checkbox, or when editing, change [ ] to [x] for the relevant item.

Local Compilation Verification Results:

image.png

Local Test Case Verification Results:

image.png

https://gitcode.com/Cangjie/cangjie_compiler/issues/459

likedislike
Pull Request已成功合入, 合并人@cangjie-ci
(感谢 yanjs 的贡献)
yanjsyanjs仓颉Developer
8月31日 关联了issue:[Bug]: cjc 在不同优化等级下编译复杂类型体操结果不一致
yanjsyanjs仓颉Developer
8月31日 添加了label:sync
cangjie-ci成员
8月31日 评论:

PR创建成功通知 | 感谢您的贡献 🎉

您好!系统已检测到您成功创建 Pull Request(PR),感谢您对项目的支持与参与!以下几点需要您着重关注:

一、PR必须关联Issue ❗️

触发门禁检查的必要步骤:在PR描述框输入Issue完整链接,完成Issue关联。

请注意,一个 Issue 不能同时关联同一 base 仓库内同一个分支的多个开启状态的 PR

二、门禁触发规则 🔧

  1. 门禁类型判定:由Issue关联的PR所属代码仓数量决定
    • 关联多个代码仓PR:触发「多仓联合门禁」
    • 关联单个代码仓PR:触发「单仓门禁」
  2. 启动指令与检查范围:需主动回复指令:
    • 回复 "start build":执行Cangjie的主要基础检查,包含commit格式检查、静态告警分析、OAT开源声明检查、多平台构建、单元/集成测试等
    • 关联同一issue的多个PR,仅需在任意一个PR里回复触发一次门禁,该PR门禁通过后,所有PR都会添加Label和测试人
    • 每个pr只能同时运行一条CI流水线,如需重新启动,请先关闭运行中的,再评论触发门禁
    • Markdown修改仅触发文档类构建测试门禁,不会触发Cangjie的编译测试门禁
    • commit 信息格式请遵循:Conventional Commits 规范
    • 请保证每一条 commit 都已添加 Signed-Off-By 信息
    • 回复 "start build cov":执行覆盖率构建工程,生成该提交的增量代码覆盖率报告

三、合入条件 ⚠️

  • 满足最低评审人数,且评审问题需全部解决;
  • 禁止合入本人创建的PR,需由其他协作者操作;
  • 合并前确保关联流水线任务运行成功(build-test-passed);
  • 需求类覆盖率门禁:当关联的 Issue 标题以 [feature]: 开头(需求类 Issue)时,联合提交中属于 cangjie_compiler、cangjie_runtime、cangjie_stdx、cangjie_tools、llvm-project 仓库的 PR,必须先回复 "start build cov" 触发增量覆盖率流水线并通过,使 PR 获得 cov-test-passed 标签后方可合入。

四、合并PR ✅

回复 "start merge",CI流水线会自动检查所有关联PR的状态、版本号标签、检视意见密度、兼容性、需求类覆盖率门禁,若所有PR都满足合并条件,则将会同时合并所有PR。若存在不满足合并条件的PR,则不会合并任何PR。

如果希望不进行兼容性相关的检测,请任一合法审查人复制以下内容,在 start merge 前提交评论:

本 pr 不需要兼容性相关检测,对于引发的任何兼容性问题(即由于本 pr 合入将导致用户需适配代码的话),由本人承担。

If you wish to avoid compatibility-related checks, please have any approver copy the following content and submit it as a comment before sending start merge:

This PR does not require compatibility-related checks. For any compatibility issues caused by this PR (i.e., if the integration of this PR will require users to adapt their code), I will take full responsibility.

五、补充说明 📢

likedislike
Ccangjie-ci维护者
8月31日 添加了label:1.1.4waiting-start-build
Ccangjie-ci维护者
8月31日 重置了测试状态
yanjs
yanjs成员
8月31日 评论:

start build

likedislike
Ccangjie-ci维护者
8月31日 删除了label:waiting-start-build
Ccangjie-ci维护者
8月31日 添加了label:CI-running
cangjie-ci成员
8月31日 评论:

🔨 构建/测试门禁流水线

已启动,正在后台运行中,您可以点击构建/测试门禁详情查看运行状态。

构建/测试门禁执行流程:

graph LR
    A[PR检测] --> B[联合构建]
    B[联合构建] --> C[测试运行]

检查内容包括

  • commitlint检查
  • 构建任务
    • linux x64、mac aarch64、windows x64
  • 测试任务
    • UT、HLT、LLT

构建/测试门禁产物归档路径: obs://cangjie103/CangjieDaily/pub/ci/gate/release/1.1/llvm-project/613

likedislike
Ccangjie-ci维护者
8月31日 添加了label:commitlint-passedsign-off-passed
cangjie-ci成员
8月31日 评论:

PR&issue 合规检查结果 / PR & Issue Compliance Check Results

Item Target Result Notes
PR template PR: Cangjie/llvm-project#613 SKIP 标签含 sync,跳过 / sync tag, skipped
Issue template Issue: Cangjie/cangjie_compiler#459 PASS 必填字段齐全 / required fields ok
PR-Issue consistency PR: Cangjie/llvm-project#613 SKIP 标签含 sync,跳过 / sync tag, skipped

检查结论 / Conclusion: PASS

likedislike
Ccangjie-ci维护者
8月31日 添加了label:OAT-passed
Ccangjie-ci维护者
8月31日 添加了label:codecheck-passed
Ccangjie-ci维护者
8月31日 添加了label:CI-runningcodecheck-passedcommitlint-passedOAT-passedsign-off-passedsync;删除了label:CI-runningcodecheck-passedcommitlint-passedOAT-passedsign-off-passedsync
cangjie-ci成员
8月31日 评论:

⚠️ Cangjie API 兼容性检查发现变化

检测到以下不兼容、新增或删除情况:

说明:当前不阻塞门禁流水线,需要相关 Committer 审查确认。

➕ 新增的 CJO 文件

interoplib.interop.cjo
java.lang.cjo
likedislike
cangjie-ci成员
8月31日 评论:

🔨 构建/测试门禁

⚠️ 构建/测试门禁失败,请点击 🔍 构建/测试门禁详情 查看完整错误信息

likedislike
Ccangjie-ci维护者
8月31日 删除了label:CI-running
Ccangjie-ci维护者
8月31日 添加了label:build-test-failedwaiting-start-build
Ccangjie-ci维护者
9月1日 删除了label:build-test-failed
Ccangjie-ci维护者
9月1日 删除了label:waiting-start-build
Ccangjie-ci维护者
9月1日 添加了label:CI-running
Ccangjie-ci维护者
9月1日 通过测试
cangjie-ci成员
9月1日 评论:

🔨 构建/测试门禁

✅ 构建/测试门禁已通过

您提交的 PR 已顺利通过全部门禁检查流程,当前状态符合合入标准。具体检查结果如下:

  • Commit 检查:代码提交信息规范性、完整性、Signed Off信息验证通过,无格式或逻辑问题✓;
  • 代码构建:编译过程无报错,依赖项加载正常,构建产物完整性达标🔧;
  • 测试验证:单元测试、集成测试等各类用例执行完毕,全部通过验证🧪。

目前该 PR 已完全具备合入条件,可按项目流程推进后续合入操作。感谢您的严谨开发与协作,期待代码顺利合入🎉!

likedislike
Ccangjie-ci维护者
9月1日 删除了label:CI-running
此处折叠了8条事件消息 查看更多
duanduan仓颉Developer
9月1日 通过了评审
yanjs
yanjs成员
17 天前 评论:

start merge

likedislike
cangjie-ci成员
17 天前 评论:

⏳ 正在进行兼容性检测中,可能需要2~3分钟,请稍候,若10分钟无检测结果,请重新回复 start merge。


⏳ Compatibility check in progress. It may take 2–3 minutes. Please wait. If there is no result after 10 minutes, please reply with start merge again.

likedislike
Timi3
Timi3成员
17 天前 评论:

[兼容性平台] 抱歉,由于服务异常,本次兼容性检测未能完成。

请重新评论 start merge 触发检测。

likedislike
yanjs
yanjs成员
16 天前 评论:

start merge

likedislike
cangjie-ci成员
16 天前 评论:

⏳ 正在进行兼容性检测中,可能需要2~3分钟,请稍候,若10分钟无检测结果,请重新回复 start merge。


⏳ Compatibility check in progress. It may take 2–3 minutes. Please wait. If there is no result after 10 minutes, please reply with start merge again.

likedislike
cangjie-ci成员
16 天前 评论:

✅ 合入前兼容性检测通过。
涉及仓库:Cangjie/llvm-project

结论

  • 分析过程:分析了 Cangjie/llvm-project#613 的提交、变更文件及 llvm/lib/Transforms/Scalar/CJDevirtualOpt.cpp 中的 subtype 推断路径,并核对扩展定义的 where 条件表示与运行时调用保留路径。 / Reviewed the commit, changed file, subtype inference, where-condition representation and retained runtime-call path.
  • 原因:该 PR 在类型参数或扩展定义缺少初始化信息、或扩展定义带有 where 条件时,不再将 CJ_MCC_IsSubType 折叠为常量;其余折叠路径保持不变。变更未修改公开声明、跨组件符号或 ABI,受影响的调用保留运行时判断,旧源码和旧二进制接口无需迁移。 / The change avoids constant folding when required information is unavailable or a where-condition applies. It preserves the other folding paths and does not require source or binary interface migration.
  • 结论:兼容
likedislike
cangjie-ci成员
16 天前 评论:

⚠️ 以下PR不具备合入条件,无法自动合并:

⚠️ The following PRs are not mergeable, cannot auto-merge:

likedislike
yanjs
yanjs成员
16 天前 评论:

start merge

likedislike
liujiajieliujiajie仓颉Committer
16 天前 通过审查
cangjie-ci成员
16 天前 评论:

⏳ 正在进行兼容性检测中,可能需要2~3分钟,请稍候,若10分钟无检测结果,请重新回复 start merge。


⏳ Compatibility check in progress. It may take 2–3 minutes. Please wait. If there is no result after 10 minutes, please reply with start merge again.

likedislike
cangjie-ci成员
16 天前 评论:

✅ 合入前兼容性检测通过。
涉及仓库:Cangjie/llvm-project

结论

  • 分析过程:分析了 Cangjie/llvm-project#613 的提交、变更文件及 llvm/lib/Transforms/Scalar/CJDevirtualOpt.cpp 中的 subtype 推断路径,并核对扩展定义的 where 条件表示与运行时调用保留路径。 / Reviewed the commit, changed file, subtype inference, where-condition representation and retained runtime-call path.
  • 原因:该 PR 在类型参数或扩展定义缺少初始化信息、或扩展定义带有 where 条件时,不再将 CJ_MCC_IsSubType 折叠为常量;其余折叠路径保持不变。变更未修改公开声明、跨组件符号或 ABI,受影响的调用保留运行时判断,旧源码和旧二进制接口无需迁移。 / The change avoids constant folding when required information is unavailable or a where-condition applies. It preserves the other folding paths and does not require source or binary interface migration.
  • 结论:兼容
likedislike
cangjie-ci成员
16 天前 评论:

✅ 以下PR将同时合入:

✅ The following PRs will be merged simultaneously:

likedislike
Ccangjie-ci维护者
16 天前 合入了pull request,合并节点 SHA:1ab72a98cfaa450c5f1d3655ab8564a9758da083