已关闭
[Bug]: O2编译崩溃 #879
kangyi创建于  5月8日关闭于  5月11日
kangyi仓颉Developer
5月8日 创建

感谢对仓颉社区的支持与关注,欢迎反馈缺陷。 | Thanks for your support and attention to the community. We welcome feedback on any issues.

发生了什么问题? | Describe the issue that occurred.

interface I<X> {
    public func test<T>(x: X, y: X): Unit {
        foo(1)
    }
    public static func foo<R>(x: R): Unit {
        println("iiii");
    }
}

open class A<X> {
    open public func test<T>(x: X, y: X): Unit {
        foo(1)
    }
    public static func foo<R>(x: R): Unit {
        println("aaaa");
    }
}

extend<R> A<R> <: I<R> {}

open class B<X> <: A<X> {
    
}

class C<T> {}

main() {
    let x = B<Int32>()
    x.test<Bool>(1, 2)
}

用例编译崩溃

期望行为是什么? | What is the expected behavior?

编译成功,运行输出aaaa

如何复现该缺陷? | How to reproduce the bug?

cjc -O2 xxx.cj

其他补充信息 | Additional information

cjc版本信息 | cjc version information

Cangjie Compiler: 0.0.1 (cjnative)
Target: x86_64-unknown-linux-gnu

分支版本信息 | Branch version information

likedislike
Kkangyi仓颉Developer
5月8日 添加了label:bug
Kkangyi仓颉Developer
5月8日 关联了pull request:fix: calculate src class type after inlining
Kkangyi仓颉Developer
5月8日 关联了pull request:fix: add test case
Kkangyi仓颉Developer
5月9日 添加了label:1.2.0-alpha.10
Kkangyi仓颉Developer
5月11日 关联了pull request:fix: add test case
Kkangyi仓颉Developer
5月11日 关联了pull request:fix: calculate src class type after inlining
Kkangyi仓颉Developer
5月11日 关联了pull request:fix: calculate src class type after inlining
Kkangyi仓颉Developer
5月11日 关联了pull request:fix: add test case
Kkangyi仓颉Developer
5月11日 关联了pull request:fix: convert to correct type
Kkangyi仓颉Developer
5月11日 关联了pull request:fix: add test case
Kkangyi仓颉Developer
5月11日 关闭了 issue