fix(tl): ctors with primitive vectors are incorrectly marked as static-size

This commit is contained in:
alina 🌸 2023-09-21 14:46:44 +03:00
parent 7a6a30ea5c
commit a3ebd3fc66
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
2 changed files with 15 additions and 0 deletions

View file

@ -50,6 +50,14 @@ export function calculateStaticSizes(
return null return null
} }
if (
arg.typeModifiers?.isVector ||
arg.typeModifiers?.isBareVector
) {
// cant be static sized
return null
}
let unionSize let unionSize
if (arg.type in PRIMITIVES_SIZES) { if (arg.type in PRIMITIVES_SIZES) {

View file

@ -41,6 +41,13 @@ describe('calculateStaticSizes', () => {
) )
}) })
it('correctly skips constructors with vector fields', () => {
test(
'help.promoData#8c39793f psa_type:Vector<int> = help.PromoData;',
{},
)
})
it('correctly handles static-sized children', () => { it('correctly handles static-sized children', () => {
test( test(
'peerUser#9db1bc6d user_id:int53 = Peer;\n' + 'peerUser#9db1bc6d user_id:int53 = Peer;\n' +