@scriptc/compiler 0.0.30 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/frontend/lowering/lower-calls.js +5 -4
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-containers.js +12 -2
- package/dist/frontend/lowering/lower-containers.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.js +32 -24
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.js +3 -2
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +26 -7
- package/dist/frontend/lowering/lowerer.js +56 -11
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/package.json +2 -2
- package/surface-manifest.json +1 -1
|
@@ -3166,12 +3166,13 @@ export function lowerVarDecl(L, decl, isLet) {
|
|
|
3166
3166
|
// adopt the initializer's type. Checker-`any[]` decls take the same
|
|
3167
3167
|
// rule (`const tlds = Array.isArray(u) ? u : [u]` — tsc's readonly
|
|
3168
3168
|
// Array.isArray quirk types the ternary any[], while the arms lower
|
|
3169
|
-
// to the union's real array arm
|
|
3169
|
+
// to the union's real array arm; readonly fixed-tuple narrows adopt
|
|
3170
|
+
// their tuple record likewise). Const only — an evolving-`any`
|
|
3170
3171
|
// `let` may be reassigned a different shape later; genuine `any`
|
|
3171
3172
|
// only — every other unmappable keeps its own diagnostic.
|
|
3172
3173
|
if (type === null && !isLet &&
|
|
3173
3174
|
((L.typeOf(decl.name).flags & ts.TypeFlags.Any) !== 0 ||
|
|
3174
|
-
(L.checkerAnyArray(decl.name) && init.type
|
|
3175
|
+
(L.checkerAnyArray(decl.name) && L.isArrayValueType(init.type)) ||
|
|
3175
3176
|
// JS declarations carry no annotations: an unmappable inferred
|
|
3176
3177
|
// type (a union with a fence-folded arm — the typeof-'bigint'
|
|
3177
3178
|
// dual-mode ternary) adopts the initializer's static type, the
|