Commit d240798
committed
Fix: detect multiple nullable ADT trait dispatch ambiguity
When multiple nullable ADT types implement the same trait method,
their null (none) variants are bare null pointers with no tag to
distinguish them. The dispatcher used nullable_adt_impls[0] for all
null values, which could dispatch to the wrong impl.
check_ambiguous_dynamic_dispatch now reports a compile error when
multiple nullable ADTs implement the same trait method, since the
ambiguity can't be resolved at runtime.1 parent 4882501 commit d240798
1 file changed
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13133 | 13133 | | |
13134 | 13134 | | |
13135 | 13135 | | |
| 13136 | + | |
| 13137 | + | |
| 13138 | + | |
| 13139 | + | |
| 13140 | + | |
| 13141 | + | |
| 13142 | + | |
| 13143 | + | |
| 13144 | + | |
| 13145 | + | |
| 13146 | + | |
| 13147 | + | |
| 13148 | + | |
| 13149 | + | |
| 13150 | + | |
| 13151 | + | |
| 13152 | + | |
| 13153 | + | |
| 13154 | + | |
| 13155 | + | |
| 13156 | + | |
| 13157 | + | |
| 13158 | + | |
| 13159 | + | |
| 13160 | + | |
| 13161 | + | |
| 13162 | + | |
| 13163 | + | |
| 13164 | + | |
| 13165 | + | |
| 13166 | + | |
| 13167 | + | |
| 13168 | + | |
| 13169 | + | |
| 13170 | + | |
| 13171 | + | |
| 13172 | + | |
| 13173 | + | |
| 13174 | + | |
| 13175 | + | |
| 13176 | + | |
| 13177 | + | |
| 13178 | + | |
| 13179 | + | |
| 13180 | + | |
| 13181 | + | |
| 13182 | + | |
13136 | 13183 | | |
13137 | 13184 | | |
13138 | 13185 | | |
| |||
0 commit comments