Commit a62ab69
committed
IRGen: Workaround for type substitution limitation
If a constrained extension has fewer conformance requirements
than the nominal type declaration, because some of the type
parameters of the nominal type are fixed to concrete types by
the extension, we would run into trouble because interface
type substitution does not correctly handle this case.
Applying an identity substitution map to an interface type
does not look up concrete types in the output generic
signature, so we get back a type parameter that is not valid.
getReducedType() has a hack to deal with this. I'd like to
get rid of the hack and fix interface type substitution to
do this correctly, but until then, this will do.
Fixes #764791 parent c9c962b commit a62ab69
File tree
2 files changed
+35
-0
lines changed- lib/IRGen
- test/IRGen
2 files changed
+35
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
117 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
118 | 132 | | |
119 | 133 | | |
120 | 134 | | |
| |||
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments