Commit 095824e
committed
AST: Fix a bug in ReplaceOpaqueTypesWithUnderlyingTypes
There was a logic error in canSubstituteTypeInto(). An existing test
(test/IRGen/opaque_result_type_private_underlying.swift) triggered
this issue with a change I'm working on. Upon further inspection
I noticed the problem can already be triggered in the same test if
we build with -O.
The problem was that we were too agressive with substituting away
opaque types away in the body of an inlinable function in a
non-resilient build. While opaque types are not resilient in this
case, we still need to keep them around if the underlying type is
insufficiently visible.1 parent 59a218a commit 095824e
File tree
3 files changed
+17
-1
lines changed- lib/AST
- test/SILGen
- Inputs
3 files changed
+17
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3150 | 3150 | | |
3151 | 3151 | | |
3152 | 3152 | | |
3153 | | - | |
| 3153 | + | |
3154 | 3154 | | |
3155 | 3155 | | |
3156 | 3156 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments