@scriptc/compiler 0.0.34 → 0.0.35
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/backend/cc-cache.test.js +969 -7
- package/dist/backend/cc-cache.test.js.map +1 -1
- package/dist/backend/cc.d.ts +90 -18
- package/dist/backend/cc.js +953 -276
- package/dist/backend/cc.js.map +1 -1
- package/dist/backend/llvm/split.d.ts +43 -0
- package/dist/backend/llvm/split.js +227 -0
- package/dist/backend/llvm/split.js.map +1 -0
- package/dist/backend/llvm/split.test.d.ts +1 -0
- package/dist/backend/llvm/split.test.js +102 -0
- package/dist/backend/llvm/split.test.js.map +1 -0
- package/dist/backend/object-localize.test.js +20 -0
- package/dist/backend/object-localize.test.js.map +1 -1
- package/dist/executable/early-cache.d.ts +86 -0
- package/dist/executable/early-cache.js +460 -0
- package/dist/executable/early-cache.js.map +1 -0
- package/dist/executable/early-cache.test.d.ts +1 -0
- package/dist/executable/early-cache.test.js +300 -0
- package/dist/executable/early-cache.test.js.map +1 -0
- package/dist/ffi/profile.d.ts +7 -2
- package/dist/ffi/profile.js +1 -0
- package/dist/ffi/profile.js.map +1 -1
- package/dist/frontend/lowering/lower-builtins.js +2 -2
- package/dist/frontend/lowering/lower-builtins.js.map +1 -1
- package/dist/frontend/lowering/lower-calls.js +14 -4
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-containers.js +18 -23
- package/dist/frontend/lowering/lower-containers.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.js +22 -10
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-island.js +3 -3
- package/dist/frontend/lowering/lower-island.js.map +1 -1
- package/dist/frontend/lowering/lower-mixins.js +1 -1
- package/dist/frontend/lowering/lower-mixins.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.js +1 -1
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +6 -0
- package/dist/frontend/lowering/lowerer.js +230 -81
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/lowering/surfaces.js +1 -1
- package/dist/frontend/lowering/surfaces.js.map +1 -1
- package/dist/frontend/program.js +42 -13
- package/dist/frontend/program.js.map +1 -1
- package/dist/frontend/ts7/checker.d.ts +40 -2
- package/dist/frontend/ts7/checker.js +194 -32
- package/dist/frontend/ts7/checker.js.map +1 -1
- package/dist/frontend/types.js +20 -42
- package/dist/frontend/types.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +219 -101
- package/dist/index.js.map +1 -1
- package/dist/ir/nodes.d.ts +6 -0
- package/dist/ir/nodes.js +28 -0
- package/dist/ir/nodes.js.map +1 -1
- package/dist/ir/validate.js +7 -1
- package/dist/ir/validate.js.map +1 -1
- package/dist/library/early-cache.js +4 -23
- package/dist/library/early-cache.js.map +1 -1
- package/dist/library/implementation-identity.d.ts +23 -0
- package/dist/library/implementation-identity.js +84 -0
- package/dist/library/implementation-identity.js.map +1 -0
- package/dist/startup-cache.d.ts +6 -0
- package/dist/startup-cache.js +6 -0
- package/dist/startup-cache.js.map +1 -0
- package/package.json +3 -2
- package/surface-manifest.json +1 -1
|
@@ -625,7 +625,7 @@ export function declaredReturnType(L, decl, blame) {
|
|
|
625
625
|
* instead of the generic supported-types recitation; a no-op for every
|
|
626
626
|
* other unmappable type (the caller's badType reports those). */
|
|
627
627
|
function fenceGenericSignatureResult(L, blame, t) {
|
|
628
|
-
const parts = t.isUnionType() ?
|
|
628
|
+
const parts = t.isUnionType() ? ts.constituentTypes(t) : [t];
|
|
629
629
|
if (!parts.some((p) => L.checker.getCallSignatures(p).some((s) => (s.typeParameters?.length ?? 0) > 0))) {
|
|
630
630
|
return;
|
|
631
631
|
}
|
|
@@ -1046,8 +1046,8 @@ export function unifySignatureBindings(L, info, rsig, bindings, tsBindings) {
|
|
|
1046
1046
|
// unbound type parameter surfaces as a mapping diagnostic later).
|
|
1047
1047
|
if (declared.isUnionType()) {
|
|
1048
1048
|
const unitFlags = ts.TypeFlags.Undefined | ts.TypeFlags.Null;
|
|
1049
|
-
const dParts =
|
|
1050
|
-
const iParts = inst.isUnionType() ?
|
|
1049
|
+
const dParts = ts.constituentTypes(declared).filter((t) => !(t.flags & unitFlags));
|
|
1050
|
+
const iParts = inst.isUnionType() ? ts.constituentTypes(inst).filter((t) => !(t.flags & unitFlags)) : [inst];
|
|
1051
1051
|
if (dParts.length === 1 && iParts.length === 1)
|
|
1052
1052
|
unify(dParts[0], iParts[0], depth + 1);
|
|
1053
1053
|
return;
|
|
@@ -1443,7 +1443,7 @@ export function lowerGenericFnValue(L, ref, info) {
|
|
|
1443
1443
|
// A `Fn | undefined`-flavored slot: the value can only inhabit the
|
|
1444
1444
|
// one callable arm — judge by it (the requireExactArityValue union
|
|
1445
1445
|
// rule).
|
|
1446
|
-
const callable =
|
|
1446
|
+
const callable = ts.constituentTypes(pinT).map((t) => L.checker.getCallSignatures(t)).filter((s) => s.length === 1);
|
|
1447
1447
|
if (callable.length === 1)
|
|
1448
1448
|
target = callable[0][0];
|
|
1449
1449
|
}
|
|
@@ -1782,6 +1782,16 @@ function internImplicitInstance(L, blame, info, shapes, argTypes) {
|
|
|
1782
1782
|
// the pinned signature over a missing body, which the linker never
|
|
1783
1783
|
// sees because the poison also fenced the call statement.
|
|
1784
1784
|
try {
|
|
1785
|
+
// Implicit-any instances lower EAGERLY at the call site so their
|
|
1786
|
+
// inferred return type is available immediately. They therefore do
|
|
1787
|
+
// not pass through emitReachable's queued generic-instance wave,
|
|
1788
|
+
// which normally batches checker work before lowering a body. Prime
|
|
1789
|
+
// this exact committed instance body here; repeated instantiations of
|
|
1790
|
+
// the same declaration find the facade memos warm.
|
|
1791
|
+
L.checker.prefetchRoots([
|
|
1792
|
+
...info.decl.parameters.flatMap((param) => param.initializer ? [param.initializer] : []),
|
|
1793
|
+
...(info.decl.body ? [info.decl.body] : []),
|
|
1794
|
+
]);
|
|
1785
1795
|
const fn = L.lowerGenericInstance(info, inst);
|
|
1786
1796
|
L.implicitFns.push(fn);
|
|
1787
1797
|
}
|