mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-03 07:54:40 +08:00
Format local-array-reads and record the preflight baseline for corpus 4671
This commit is contained in:
@@ -115,10 +115,19 @@ function inlineArrayRead(
|
||||
nullable?.(value.type.unionId) !== true
|
||||
)
|
||||
return null;
|
||||
return { type: value.type, element, presentTag, missingTag, array, index, nullableElement: true };
|
||||
return {
|
||||
type: value.type,
|
||||
element,
|
||||
presentTag,
|
||||
missingTag,
|
||||
array,
|
||||
index,
|
||||
nullableElement: true,
|
||||
};
|
||||
}
|
||||
const element = array.type.elem;
|
||||
if ((!isRefCounted(element) && !isScalarElement(element)) || element.kind === "union") return null;
|
||||
if ((!isRefCounted(element) && !isScalarElement(element)) || element.kind === "union")
|
||||
return null;
|
||||
const presentTag = arms.findIndex((arm) => typeEquals(arm, element));
|
||||
if (presentTag < 0 || then.kind !== "unionWrap" || then.tag !== presentTag) return null;
|
||||
return { type: value.type, element, presentTag, missingTag, array, index };
|
||||
|
||||
@@ -15859,6 +15859,12 @@
|
||||
"<repo>/tests/corpus/constant-module-globals/main.ts"
|
||||
],
|
||||
"diags": []
|
||||
},
|
||||
"<repo>/tests/corpus/4671-scoped-array-read-borrows.ts": {
|
||||
"order": [
|
||||
"<repo>/tests/corpus/4671-scoped-array-read-borrows.ts"
|
||||
],
|
||||
"diags": []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user