Commit 2d127bc
committed
markused: keep str_intp for aliases whose codegen wraps parent str()
When a `type Foo = Bar` alias has no str method of its own but its parent
type does, cgen emits a wrapper `indent_Foo_str` that calls
`builtin__str_intp` to format `'Foo(...)'` around the parent's str output
(auto_str_methods.v gen_str_for_alias). type_auto_str_needs_str_intp was
unaliasing first and seeing the parent's str method, so it returned false
and -skip-unused dropped str_intp / StrIntpData, producing `implicit
declaration of function 'builtin__str_intp'` for any program that just
calls .str() on an SDL Version (and other c2v-style aliases).
Check the pre-unaliased sym for the Alias-without-own-str case before
falling through to the unaliased-parent-has-str shortcut.1 parent a069b12 commit 2d127bc
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2842 | 2842 | | |
2843 | 2843 | | |
2844 | 2844 | | |
| 2845 | + | |
| 2846 | + | |
| 2847 | + | |
| 2848 | + | |
2845 | 2849 | | |
2846 | 2850 | | |
2847 | 2851 | | |
| |||
0 commit comments