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-4425] SIL verifier failure when partially applying method that's overridden in a concrete subclass of a generic class #47002

Closed
slavapestov opened this issue Mar 30, 2017 · 3 comments
Assignees
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 SILGen Area → compiler: The SIL generation stage

Comments

@slavapestov
Copy link
Member

Previous ID SR-4425
Radar rdar://45671537
Original Reporter @slavapestov
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, CompilerCrash, SILGen
Assignee @rjmccall
Priority Medium

md5: f1ac0b74e18c9f0db9faf5c365bc1948

Issue Description:

SIL verification failed: convert_function cannot change function ABI
  different number of parameters
  @callee_owned (@in (Int, Float)) -> ()
  @callee_owned (Int, Float) -> ()

class C<T> {
 func f(t: T) {
   print(t)
 }
}

class B : C<(Int, Float)> {
 override func f(t: (Int, Float)) {
   print(t)
 }
}

let fn1: (C<(Int, Float)>) -> ((Int, Float)) -> () = C.f
let fn2: (B) -> ((Int, Float)) -> () = B.f

fn1(B())((100, 200.0))
fn2(B())((100, 200.0))

fn1 works, fn2 does not. Maybe the convert_function should just be an emitOrigToSubst(), except you'll need to figure out the right AST types to use there.

@swift-ci
Copy link
Collaborator

Comment by Erik Little (JIRA)

@slavapestov If you end up solving this, could you tag me in the PR? I'm very interested in learning how you go about solving it! I unfortunately have had to put this down yet again.

It's nuclearace on Github.

@rjmccall
Copy link
Member

#21932

@rjmccall
Copy link
Member

I can't promise that this will be fixed in 5.0, but it's at least fixed on master.

@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 SILGen Area → compiler: The SIL generation stage
Projects
None yet
Development

No branches or pull requests

4 participants