forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SILVerifier: fix a wrong check for witness_method instructions
Consider that the lookup-type can be an opaque return type. Also fixing the SILPrinter. Fixes a verifier crash swiftlang#77955 140939536
- Loading branch information
Showing
3 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// RUN: %target-run-simple-swift(-O -Xfrontend -sil-verify-all) | %FileCheck %s | ||
|
||
protocol P {} | ||
extension P { | ||
func foo() -> some Sequence<Int> { | ||
[1, 2, 3] | ||
} | ||
} | ||
|
||
struct B { | ||
let p: P | ||
|
||
@inline(never) | ||
func bar() { | ||
for x in p.foo() { | ||
print(x) | ||
} | ||
} | ||
} | ||
|
||
|
||
struct S : P { | ||
var x = 0 | ||
} | ||
|
||
|
||
let b = B(p: S()) | ||
|
||
// CHECK: 1 | ||
// CHECK-NEXT: 2 | ||
// CHECK-NEXT: 3 | ||
b.bar() | ||
|