Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-8128] "Illegal instruction: 4" when a generic type can't be inferred #50660

Closed
swift-ci opened this issue Jun 27, 2018 · 2 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software type checker Area → compiler: Semantic analysis

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-8128
Radar rdar://problem/41591674
Original Reporter Vermeulen (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Xcode 10.0 beta 2 with the Swift 4.2 toolchain. Getting the same error with the 06/26 snapshot of the master toolchain.

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, TypeChecker
Assignee None
Priority Medium

md5: a0251ad2fdcb44691305c0532bba98c6

Issue Description:

protocol Foo { associatedtype A }
struct Bar<T: Foo> { init(_ x: T.A?) {} }
Bar(nil)

This causes the compilation to fail with "error: Illegal instruction: 4"

@belkadan
Copy link
Contributor

Infinite recursion in

frame #&#8203;201: 0x0000000100e5fdc9 swift`swift::constraints::ConstraintSystem::solveSimplified(this=0x00007ffeefbfa578, disjunction=0x0000000000000000, solutions=0x00007ffeefbfb1d8, allowFreeTypeVariables=Disallow) at CSSolver.cpp:1925 [opt]
frame #&#8203;202: 0x0000000100e5ccda swift`swift::constraints::ConstraintSystem::solveRec(this=<unavailable>, solutions=0x00007ffeefbfb1d8, allowFreeTypeVariables=Disallow) at CSSolver.cpp:1489 [opt]
frame #&#8203;203: 0x0000000100e5b87c swift`swift::constraints::ConstraintSystem::tryTypeVariableBindings(this=<unavailable>, depth=3358, typeVar=<unavailable>, bindings=<unavailable>, solutions=0x00007ffeefbfb1d8, allowFreeTypeVariables=Disallow) at CSSolver.cpp:677 [opt]

@swift-ci create

@swift-ci
Copy link
Collaborator Author

swift-ci commented Apr 6, 2019

Comment by Tim (JIRA)

No longer crashes the compiler in Swift 5, now it simply doesn't compile, as expected.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

3 participants