Split out of #1595 (report 3 of 9) — filed by @rrodriguesNutrium, credit to them.
writer.py:405 (and :409):
b[k] = [str(x) for x in v] if v else [""]
So a function with decorators: [] persists as [""], not []. This affects every language and every list-valued property, args included.
Confirmed still present on current main — an un-annotated Kotlin function stores f.decorators = [""].
It does not break find_dead_code ("" CONTAINS 'Preview' is false, so un-annotated functions are correctly retained), but [""] isn't what any caller means by "none", and it forces every consumer to special-case a one-element list containing the empty string.
Worth checking why the else branch exists before changing it — it may be working around a backend that rejects empty lists, in which case the fix belongs at the read boundary instead.
Split out of #1595 (report 3 of 9) — filed by @rrodriguesNutrium, credit to them.
writer.py:405(and:409):So a function with
decorators: []persists as[""], not[]. This affects every language and every list-valued property,argsincluded.Confirmed still present on current
main— an un-annotated Kotlin function storesf.decorators = [""].It does not break
find_dead_code("" CONTAINS 'Preview'is false, so un-annotated functions are correctly retained), but[""]isn't what any caller means by "none", and it forces every consumer to special-case a one-element list containing the empty string.Worth checking why the
elsebranch exists before changing it — it may be working around a backend that rejects empty lists, in which case the fix belongs at the read boundary instead.