lang: add read-only type decorators

This commit is contained in:
Nigel Tao committed 2023-04-10 15:29:12 +10:00
1 parent 6e8349129c
commit f3caf09d77
14 files changed
+132 -77

No files matched your search

+1 -1
View File
@@ -342,7 +342,7 @@ func writeOutParamZeroValue(b *buffer, tm *t.Map, typ *a.TypeExpr) error {
} else if typ.IsNumType() {
b.writes("0")
return nil
} else if typ.IsSliceType() {
} else if typ.IsEitherSliceType() {
if inner := typ.Inner(); (inner.Decorator() == 0) && (inner.QID() == t.QID{t.IDBase, t.IDU8}) {
b.writes("wuffs_base__make_slice_u8(NULL, 0)")
return nil