@scriptc/compiler 0.0.0 → 0.0.1
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/LICENSE +202 -0
- package/ambient/package.json +3 -0
- package/ambient/scriptc-node-fallback.d.ts +3001 -0
- package/ambient/scriptc-overrides.d.ts +95 -0
- package/ambient/scriptc.d.ts +74 -0
- package/dist/backend/cc.d.ts +169 -0
- package/dist/backend/cc.js +897 -0
- package/dist/backend/cc.js.map +1 -0
- package/dist/backend/emission/emit-async.d.ts +145 -0
- package/dist/backend/emission/emit-async.js +996 -0
- package/dist/backend/emission/emit-async.js.map +1 -0
- package/dist/backend/emission/emit-exprs.d.ts +3 -0
- package/dist/backend/emission/emit-exprs.js +5947 -0
- package/dist/backend/emission/emit-exprs.js.map +1 -0
- package/dist/backend/emission/emit-island.d.ts +45 -0
- package/dist/backend/emission/emit-island.js +271 -0
- package/dist/backend/emission/emit-island.js.map +1 -0
- package/dist/backend/emission/emit-shapes.d.ts +142 -0
- package/dist/backend/emission/emit-shapes.js +575 -0
- package/dist/backend/emission/emit-shapes.js.map +1 -0
- package/dist/backend/emission/emit-stmts.d.ts +78 -0
- package/dist/backend/emission/emit-stmts.js +960 -0
- package/dist/backend/emission/emit-stmts.js.map +1 -0
- package/dist/backend/emission/emit-types.d.ts +65 -0
- package/dist/backend/emission/emit-types.js +652 -0
- package/dist/backend/emission/emit-types.js.map +1 -0
- package/dist/backend/emission/emit-walkers.d.ts +154 -0
- package/dist/backend/emission/emit-walkers.js +1587 -0
- package/dist/backend/emission/emit-walkers.js.map +1 -0
- package/dist/backend/emission/emitter.d.ts +452 -0
- package/dist/backend/emission/emitter.js +1249 -0
- package/dist/backend/emission/emitter.js.map +1 -0
- package/dist/backend/emission/may-throw.d.ts +15 -0
- package/dist/backend/emission/may-throw.js +250 -0
- package/dist/backend/emission/may-throw.js.map +1 -0
- package/dist/backend/llvm/blocks.d.ts +21 -0
- package/dist/backend/llvm/blocks.js +68 -0
- package/dist/backend/llvm/blocks.js.map +1 -0
- package/dist/backend/llvm/classes.d.ts +84 -0
- package/dist/backend/llvm/classes.js +438 -0
- package/dist/backend/llvm/classes.js.map +1 -0
- package/dist/backend/llvm/dyn.d.ts +123 -0
- package/dist/backend/llvm/dyn.js +2624 -0
- package/dist/backend/llvm/dyn.js.map +1 -0
- package/dist/backend/llvm/emitter.d.ts +3 -0
- package/dist/backend/llvm/emitter.js +10087 -0
- package/dist/backend/llvm/emitter.js.map +1 -0
- package/dist/backend/llvm/shapes.d.ts +78 -0
- package/dist/backend/llvm/shapes.js +754 -0
- package/dist/backend/llvm/shapes.js.map +1 -0
- package/dist/backend/llvm/unsupported.d.ts +6 -0
- package/dist/backend/llvm/unsupported.js +12 -0
- package/dist/backend/llvm/unsupported.js.map +1 -0
- package/dist/backend/llvm/walkers.d.ts +58 -0
- package/dist/backend/llvm/walkers.js +793 -0
- package/dist/backend/llvm/walkers.js.map +1 -0
- package/dist/backend/mangle.d.ts +124 -0
- package/dist/backend/mangle.js +232 -0
- package/dist/backend/mangle.js.map +1 -0
- package/dist/coverage/report.d.ts +64 -0
- package/dist/coverage/report.js +226 -0
- package/dist/coverage/report.js.map +1 -0
- package/dist/diagnostics/diagnostic.d.ts +140 -0
- package/dist/diagnostics/diagnostic.js +458 -0
- package/dist/diagnostics/diagnostic.js.map +1 -0
- package/dist/diagnostics/render.d.ts +11 -0
- package/dist/diagnostics/render.js +58 -0
- package/dist/diagnostics/render.js.map +1 -0
- package/dist/frontend/cjs-lexer.d.ts +20 -0
- package/dist/frontend/cjs-lexer.js +813 -0
- package/dist/frontend/cjs-lexer.js.map +1 -0
- package/dist/frontend/lowering/http2-constants.d.ts +1 -0
- package/dist/frontend/lowering/http2-constants.js +251 -0
- package/dist/frontend/lowering/http2-constants.js.map +1 -0
- package/dist/frontend/lowering/lib-boundary.d.ts +6 -0
- package/dist/frontend/lowering/lib-boundary.js +143 -0
- package/dist/frontend/lowering/lib-boundary.js.map +1 -0
- package/dist/frontend/lowering/lower-assert.d.ts +18 -0
- package/dist/frontend/lowering/lower-assert.js +1269 -0
- package/dist/frontend/lowering/lower-assert.js.map +1 -0
- package/dist/frontend/lowering/lower-builtins.d.ts +511 -0
- package/dist/frontend/lowering/lower-builtins.js +5249 -0
- package/dist/frontend/lowering/lower-builtins.js.map +1 -0
- package/dist/frontend/lowering/lower-calls.d.ts +581 -0
- package/dist/frontend/lowering/lower-calls.js +6281 -0
- package/dist/frontend/lowering/lower-calls.js.map +1 -0
- package/dist/frontend/lowering/lower-classes.d.ts +727 -0
- package/dist/frontend/lowering/lower-classes.js +4701 -0
- package/dist/frontend/lowering/lower-classes.js.map +1 -0
- package/dist/frontend/lowering/lower-comptime.d.ts +53 -0
- package/dist/frontend/lowering/lower-comptime.js +244 -0
- package/dist/frontend/lowering/lower-comptime.js.map +1 -0
- package/dist/frontend/lowering/lower-containers.d.ts +483 -0
- package/dist/frontend/lowering/lower-containers.js +6281 -0
- package/dist/frontend/lowering/lower-containers.js.map +1 -0
- package/dist/frontend/lowering/lower-dgram.d.ts +20 -0
- package/dist/frontend/lowering/lower-dgram.js +319 -0
- package/dist/frontend/lowering/lower-dgram.js.map +1 -0
- package/dist/frontend/lowering/lower-emitter.d.ts +10 -0
- package/dist/frontend/lowering/lower-emitter.js +688 -0
- package/dist/frontend/lowering/lower-emitter.js.map +1 -0
- package/dist/frontend/lowering/lower-enums.d.ts +22 -0
- package/dist/frontend/lowering/lower-enums.js +235 -0
- package/dist/frontend/lowering/lower-enums.js.map +1 -0
- package/dist/frontend/lowering/lower-expando.d.ts +35 -0
- package/dist/frontend/lowering/lower-expando.js +276 -0
- package/dist/frontend/lowering/lower-expando.js.map +1 -0
- package/dist/frontend/lowering/lower-exprs.d.ts +524 -0
- package/dist/frontend/lowering/lower-exprs.js +8099 -0
- package/dist/frontend/lowering/lower-exprs.js.map +1 -0
- package/dist/frontend/lowering/lower-generators.d.ts +50 -0
- package/dist/frontend/lowering/lower-generators.js +421 -0
- package/dist/frontend/lowering/lower-generators.js.map +1 -0
- package/dist/frontend/lowering/lower-inspect.d.ts +20 -0
- package/dist/frontend/lowering/lower-inspect.js +1069 -0
- package/dist/frontend/lowering/lower-inspect.js.map +1 -0
- package/dist/frontend/lowering/lower-island.d.ts +108 -0
- package/dist/frontend/lowering/lower-island.js +650 -0
- package/dist/frontend/lowering/lower-island.js.map +1 -0
- package/dist/frontend/lowering/lower-mixins.d.ts +96 -0
- package/dist/frontend/lowering/lower-mixins.js +534 -0
- package/dist/frontend/lowering/lower-mixins.js.map +1 -0
- package/dist/frontend/lowering/lower-modules.d.ts +135 -0
- package/dist/frontend/lowering/lower-modules.js +1613 -0
- package/dist/frontend/lowering/lower-modules.js.map +1 -0
- package/dist/frontend/lowering/lower-namespaces.d.ts +168 -0
- package/dist/frontend/lowering/lower-namespaces.js +706 -0
- package/dist/frontend/lowering/lower-namespaces.js.map +1 -0
- package/dist/frontend/lowering/lower-server.d.ts +90 -0
- package/dist/frontend/lowering/lower-server.js +3471 -0
- package/dist/frontend/lowering/lower-server.js.map +1 -0
- package/dist/frontend/lowering/lower-stmts.d.ts +361 -0
- package/dist/frontend/lowering/lower-stmts.js +5341 -0
- package/dist/frontend/lowering/lower-stmts.js.map +1 -0
- package/dist/frontend/lowering/lower-stream.d.ts +88 -0
- package/dist/frontend/lowering/lower-stream.js +1533 -0
- package/dist/frontend/lowering/lower-stream.js.map +1 -0
- package/dist/frontend/lowering/lower-test.d.ts +27 -0
- package/dist/frontend/lowering/lower-test.js +353 -0
- package/dist/frontend/lowering/lower-test.js.map +1 -0
- package/dist/frontend/lowering/lowerer.d.ts +1748 -0
- package/dist/frontend/lowering/lowerer.js +6256 -0
- package/dist/frontend/lowering/lowerer.js.map +1 -0
- package/dist/frontend/lowering/surfaces.d.ts +272 -0
- package/dist/frontend/lowering/surfaces.js +1096 -0
- package/dist/frontend/lowering/surfaces.js.map +1 -0
- package/dist/frontend/npm-static.d.ts +55 -0
- package/dist/frontend/npm-static.js +300 -0
- package/dist/frontend/npm-static.js.map +1 -0
- package/dist/frontend/npm.d.ts +330 -0
- package/dist/frontend/npm.js +1259 -0
- package/dist/frontend/npm.js.map +1 -0
- package/dist/frontend/program.d.ts +186 -0
- package/dist/frontend/program.js +2172 -0
- package/dist/frontend/program.js.map +1 -0
- package/dist/frontend/provenance-registry.d.ts +48 -0
- package/dist/frontend/provenance-registry.js +87 -0
- package/dist/frontend/provenance-registry.js.map +1 -0
- package/dist/frontend/provenance.d.ts +6 -0
- package/dist/frontend/provenance.js +459 -0
- package/dist/frontend/provenance.js.map +1 -0
- package/dist/frontend/resolve.d.ts +56 -0
- package/dist/frontend/resolve.js +682 -0
- package/dist/frontend/resolve.js.map +1 -0
- package/dist/frontend/shared.d.ts +60 -0
- package/dist/frontend/shared.js +232 -0
- package/dist/frontend/shared.js.map +1 -0
- package/dist/frontend/ts7/adapter.d.ts +7 -0
- package/dist/frontend/ts7/adapter.js +54 -0
- package/dist/frontend/ts7/adapter.js.map +1 -0
- package/dist/frontend/ts7/ast.d.ts +50 -0
- package/dist/frontend/ts7/ast.js +211 -0
- package/dist/frontend/ts7/ast.js.map +1 -0
- package/dist/frontend/ts7/census-check.d.ts +1 -0
- package/dist/frontend/ts7/census-check.js +12 -0
- package/dist/frontend/ts7/census-check.js.map +1 -0
- package/dist/frontend/ts7/checker.d.ts +140 -0
- package/dist/frontend/ts7/checker.js +544 -0
- package/dist/frontend/ts7/checker.js.map +1 -0
- package/dist/frontend/ts7/enums.d.ts +18 -0
- package/dist/frontend/ts7/enums.js +43 -0
- package/dist/frontend/ts7/enums.js.map +1 -0
- package/dist/frontend/ts7/program.d.ts +99 -0
- package/dist/frontend/ts7/program.js +278 -0
- package/dist/frontend/ts7/program.js.map +1 -0
- package/dist/frontend/ts7/world-check.d.ts +3 -0
- package/dist/frontend/ts7/world-check.js +34 -0
- package/dist/frontend/ts7/world-check.js.map +1 -0
- package/dist/frontend/types.d.ts +205 -0
- package/dist/frontend/types.js +2485 -0
- package/dist/frontend/types.js.map +1 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.js +424 -0
- package/dist/index.js.map +1 -0
- package/dist/ir/nodes.d.ts +4334 -0
- package/dist/ir/nodes.js +1906 -0
- package/dist/ir/nodes.js.map +1 -0
- package/dist/ir/serialize.d.ts +4 -0
- package/dist/ir/serialize.js +34 -0
- package/dist/ir/serialize.js.map +1 -0
- package/dist/ir/validate.d.ts +36 -0
- package/dist/ir/validate.js +4884 -0
- package/dist/ir/validate.js.map +1 -0
- package/package.json +30 -6
- package/README.md +0 -3
- package/index.js +0 -2
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
/* Mixin heritage: `class D extends Serializable(Base)` and the
|
|
2
|
+
* `Constructor<T>`-parameterized mixin-function pattern, monomorphized per
|
|
3
|
+
* call site.
|
|
4
|
+
*
|
|
5
|
+
* The honest static mixin is a function whose parameter and return are
|
|
6
|
+
* class values with statically-traceable flow:
|
|
7
|
+
*
|
|
8
|
+
* function Tagged<T extends Ctor>(Base: T) {
|
|
9
|
+
* class C extends Base { ... }
|
|
10
|
+
* return C;
|
|
11
|
+
* }
|
|
12
|
+
*
|
|
13
|
+
* Called with a concrete program class, the class inside the mixin
|
|
14
|
+
* instantiates PER CALL SITE — its heritage is the ARGUMENT class, its
|
|
15
|
+
* members lower under the mixin's type-parameter binding (T → the
|
|
16
|
+
* argument's classval), and the call expression's value is the
|
|
17
|
+
* instantiation's immortal class object (classRef). Everything downstream
|
|
18
|
+
* rides the classval machinery unchanged: `new` through the value,
|
|
19
|
+
* instanceof against the result and against every base (interval nesting
|
|
20
|
+
* through the monomorphized chain), statics, `extends` of the result.
|
|
21
|
+
*
|
|
22
|
+
* Keying by CALL SITE (position-derived `%mx<start>.<name>` names, the
|
|
23
|
+
* class-expression trick) is what makes one immortal class object exact:
|
|
24
|
+
* each supported call position evaluates exactly once, so JS's
|
|
25
|
+
* fresh-class-per-call semantics collapses to one class per site. Calls
|
|
26
|
+
* inside functions or class members would mint a distinct class per
|
|
27
|
+
* evaluation and are named fences.
|
|
28
|
+
*
|
|
29
|
+
* Named fences (never silent divergence): mixin functions whose base
|
|
30
|
+
* parameter flow isn't traceable (the parameter referenced anywhere but
|
|
31
|
+
* the extends clause, extra statements in the body), mixins over builtin
|
|
32
|
+
* or decorated or generic-family classes, calls whose argument isn't
|
|
33
|
+
* statically one program class, mixin calls inside functions/members, and
|
|
34
|
+
* statics-bearing mixin classes outside a plain top-level statement
|
|
35
|
+
* (their declaration-time code must run exactly where the call
|
|
36
|
+
* evaluates). */
|
|
37
|
+
import * as ts from "../ts7/adapter.js";
|
|
38
|
+
import { PoisonError } from "./lowerer.js";
|
|
39
|
+
import { builtinStreamInfoOf, exactClassOfReceiver, propertyAssignedClassInfoOf } from "./lower-classes.js";
|
|
40
|
+
/** Strips parentheses. */
|
|
41
|
+
function unparen(e) {
|
|
42
|
+
while (ts.isParenthesizedExpression(e))
|
|
43
|
+
e = e.expression;
|
|
44
|
+
return e;
|
|
45
|
+
}
|
|
46
|
+
/** The class a mixin FUNCTION's body defines and returns, with every
|
|
47
|
+
* traceability requirement checked — null when the function is not a
|
|
48
|
+
* (supported) mixin. Cached per function node; recognition is pure (no
|
|
49
|
+
* diagnostics, no registration), so a null answer simply leaves the call
|
|
50
|
+
* to the generic/direct machinery and ITS fences. */
|
|
51
|
+
export function mixinFnShapeOf(L, fn) {
|
|
52
|
+
const cached = L.mixinFnShapes.get(fn);
|
|
53
|
+
if (cached !== undefined)
|
|
54
|
+
return cached;
|
|
55
|
+
const shape = mixinFnShapeInner(L, fn);
|
|
56
|
+
L.mixinFnShapes.set(fn, shape);
|
|
57
|
+
return shape;
|
|
58
|
+
}
|
|
59
|
+
function mixinFnShapeInner(L, fn) {
|
|
60
|
+
if (fn.asteriskToken)
|
|
61
|
+
return null;
|
|
62
|
+
if (ts.getModifiers(fn)?.some((m) => m.kind === ts.SyntaxKind.AsyncKeyword))
|
|
63
|
+
return null;
|
|
64
|
+
if (fn.parameters.length !== 1)
|
|
65
|
+
return null;
|
|
66
|
+
const p = fn.parameters[0];
|
|
67
|
+
if (!ts.isIdentifier(p.name) || p.dotDotDotToken || p.questionToken || p.initializer)
|
|
68
|
+
return null;
|
|
69
|
+
const paramSym = L.checker.getSymbolAtLocation(p.name);
|
|
70
|
+
if (!paramSym || !fn.body)
|
|
71
|
+
return null;
|
|
72
|
+
// The body must define-and-return exactly one class: an arrow whose
|
|
73
|
+
// expression body IS the class, `{ return class … }`, or `{ class C …
|
|
74
|
+
// return C; }`. Anything else (extra statements — side effects we would
|
|
75
|
+
// not execute) disqualifies.
|
|
76
|
+
let classNode = null;
|
|
77
|
+
if (!ts.isBlock(fn.body)) {
|
|
78
|
+
const e = unparen(fn.body);
|
|
79
|
+
if (ts.isClassExpression(e))
|
|
80
|
+
classNode = e;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
const stmts = fn.body.statements;
|
|
84
|
+
if (stmts.length === 1 && ts.isReturnStatement(stmts[0]) && stmts[0].expression) {
|
|
85
|
+
const e = unparen(stmts[0].expression);
|
|
86
|
+
if (ts.isClassExpression(e))
|
|
87
|
+
classNode = e;
|
|
88
|
+
}
|
|
89
|
+
else if (stmts.length === 2 &&
|
|
90
|
+
ts.isClassDeclaration(stmts[0]) &&
|
|
91
|
+
stmts[0].name !== undefined &&
|
|
92
|
+
ts.isReturnStatement(stmts[1]) &&
|
|
93
|
+
stmts[1].expression !== undefined) {
|
|
94
|
+
const ret = unparen(stmts[1].expression);
|
|
95
|
+
if (ts.isIdentifier(ret)) {
|
|
96
|
+
const clsSym = L.checker.getSymbolAtLocation(stmts[0].name);
|
|
97
|
+
if (clsSym && L.checker.getSymbolAtLocation(ret) === clsSym)
|
|
98
|
+
classNode = stmts[0];
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (!classNode)
|
|
103
|
+
return null;
|
|
104
|
+
// A generic class would mint a FAMILY per call; decorators are
|
|
105
|
+
// declaration-time calls with per-evaluation semantics — both
|
|
106
|
+
// disqualify (decorator-composed mixins are a named non-goal).
|
|
107
|
+
if (classNode.typeParameters)
|
|
108
|
+
return null;
|
|
109
|
+
const mods = classNode.modifiers ?? [];
|
|
110
|
+
if (mods.some((m) => m.kind === ts.SyntaxKind.Decorator))
|
|
111
|
+
return null;
|
|
112
|
+
// Heritage: exactly `extends <the parameter>`.
|
|
113
|
+
const clauses = classNode.heritageClauses ?? [];
|
|
114
|
+
if (clauses.length !== 1 || clauses[0].token !== ts.SyntaxKind.ExtendsKeyword)
|
|
115
|
+
return null;
|
|
116
|
+
const types = clauses[0].types;
|
|
117
|
+
if (types.length !== 1)
|
|
118
|
+
return null;
|
|
119
|
+
const t = types[0];
|
|
120
|
+
if (t.typeArguments || !ts.isIdentifier(t.expression))
|
|
121
|
+
return null;
|
|
122
|
+
if (L.checker.getSymbolAtLocation(t.expression) !== paramSym)
|
|
123
|
+
return null;
|
|
124
|
+
// The parameter's flow must be fully traceable: the extends clause is
|
|
125
|
+
// its ONE reference (a parameter that is stored, compared, reassigned,
|
|
126
|
+
// or read inside members is dynamic base flow).
|
|
127
|
+
let extraRef = false;
|
|
128
|
+
ts.walkPreorder(fn.body, (n) => {
|
|
129
|
+
if (n === t.expression)
|
|
130
|
+
return undefined;
|
|
131
|
+
if (ts.isIdentifier(n) && n.text === p.name.getText() && L.checker.getSymbolAtLocation(n) === paramSym) {
|
|
132
|
+
extraRef = true;
|
|
133
|
+
return "stop";
|
|
134
|
+
}
|
|
135
|
+
return undefined;
|
|
136
|
+
});
|
|
137
|
+
if (extraRef)
|
|
138
|
+
return null;
|
|
139
|
+
// The parameter's own type parameter, when it has one (`<T extends
|
|
140
|
+
// Ctor>(Base: T)`): instantiations bind it to the argument's classval.
|
|
141
|
+
let paramTypeParam = null;
|
|
142
|
+
if (p.type && ts.isTypeReferenceNode(p.type) && ts.isIdentifier(p.type.typeName)) {
|
|
143
|
+
const refSym = L.checker.getSymbolAtLocation(p.type.typeName);
|
|
144
|
+
if (refSym &&
|
|
145
|
+
fn.typeParameters?.some((tp) => L.checker.getSymbolAtLocation(tp.name) === refSym)) {
|
|
146
|
+
paramTypeParam = refSym;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
const name = (ts.isFunctionDeclaration(fn) ? fn.name?.text : undefined) ??
|
|
150
|
+
(ts.isVariableDeclaration(fn.parent) && ts.isIdentifier(fn.parent.name)
|
|
151
|
+
? fn.parent.name.text
|
|
152
|
+
: "%anon");
|
|
153
|
+
return { fn, paramSym, paramTypeParam, classNode, name };
|
|
154
|
+
}
|
|
155
|
+
/** The mixin function a CALLEE expression names, or null: an identifier
|
|
156
|
+
* resolving to a single function declaration or a const binding holding
|
|
157
|
+
* an arrow/function expression (never-reassigned by constness), whose
|
|
158
|
+
* shape qualifies. */
|
|
159
|
+
export function mixinFnOfCallee(L, callee) {
|
|
160
|
+
if (!ts.isIdentifier(callee))
|
|
161
|
+
return null;
|
|
162
|
+
// A shadowing local owns the name (heritage-time demands have no
|
|
163
|
+
// function context — nothing can shadow at collection).
|
|
164
|
+
if (L.fnStack.length > 0 && L.resolveLocal(callee))
|
|
165
|
+
return null;
|
|
166
|
+
// Recognition is a side-effect-free PROBE (it runs on every candidate
|
|
167
|
+
// call/binding/reference): resolve without resolveValueSymbol's
|
|
168
|
+
// deferred-diagnostic flush — a non-mixin callee's own paths flush when
|
|
169
|
+
// THEY resolve it.
|
|
170
|
+
let sym = L.checker.getSymbolAtLocation(callee) ?? null;
|
|
171
|
+
if (sym && sym.flags & ts.SymbolFlags.Alias)
|
|
172
|
+
sym = L.checker.getAliasedSymbol(sym);
|
|
173
|
+
if (!sym)
|
|
174
|
+
return null;
|
|
175
|
+
const decls = L.checker.declarationsOf(sym);
|
|
176
|
+
if (decls.length !== 1 || decls[0] === undefined)
|
|
177
|
+
return null; // overloads / merged declarations
|
|
178
|
+
const d = decls[0];
|
|
179
|
+
if (ts.isFunctionDeclaration(d))
|
|
180
|
+
return mixinFnShapeOf(L, d);
|
|
181
|
+
if (ts.isVariableDeclaration(d)) {
|
|
182
|
+
const fn = mixinFnNodeOfBinding(d);
|
|
183
|
+
return fn ? mixinFnShapeOf(L, fn) : null;
|
|
184
|
+
}
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
/** The arrow/function-expression initializer of a CONST binding — the
|
|
188
|
+
* value-binding spelling of a mixin function declaration. */
|
|
189
|
+
export function mixinFnNodeOfBinding(decl) {
|
|
190
|
+
if (!ts.isIdentifier(decl.name) || decl.initializer === undefined)
|
|
191
|
+
return null;
|
|
192
|
+
if (!ts.isVariableDeclarationList(decl.parent) ||
|
|
193
|
+
(decl.parent.flags & ts.NodeFlags.Const) === 0) {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
const init = unparen(decl.initializer);
|
|
197
|
+
return ts.isArrowFunction(init) || ts.isFunctionExpression(init) ? init : null;
|
|
198
|
+
}
|
|
199
|
+
/** True when this variable declaration is a recognized mixin FUNCTION
|
|
200
|
+
* binding (`const M = (Base: T) => class extends Base {…}`): no global
|
|
201
|
+
* exists (the binding is never read as a value; calls instantiate per
|
|
202
|
+
* site), and both collectGlobals and the statement lowering skip it by
|
|
203
|
+
* this test. */
|
|
204
|
+
export function isMixinFnBinding(L, decl) {
|
|
205
|
+
const fn = mixinFnNodeOfBinding(decl);
|
|
206
|
+
return fn !== null && mixinFnShapeOf(L, fn) !== null;
|
|
207
|
+
}
|
|
208
|
+
/** The class a mixin ARGUMENT statically names, with every unsupported
|
|
209
|
+
* argument shape a named fence (recognition already established the call
|
|
210
|
+
* is a mixin call — from here failures are honest diagnostics, never a
|
|
211
|
+
* fallthrough to a wronger message). */
|
|
212
|
+
function mixinBaseClassOf(L, arg) {
|
|
213
|
+
const e = unparen(arg);
|
|
214
|
+
// A nested mixin call: `Tagged(Printable(Derived))` — the inner
|
|
215
|
+
// instantiation is the outer's base (instantiated first, exactly JS's
|
|
216
|
+
// argument-before-call order).
|
|
217
|
+
if (ts.isCallExpression(e)) {
|
|
218
|
+
const inner = mixinCallClassInfoOf(L, e);
|
|
219
|
+
if (inner)
|
|
220
|
+
return inner;
|
|
221
|
+
L.unsupported("SC1090", arg, "mixin arguments that are calls of anything but another mixin function (the base class must be statically known)");
|
|
222
|
+
}
|
|
223
|
+
// A class expression argument: `Tagged(class { … })` — collected like
|
|
224
|
+
// any expression class (its own position fences apply).
|
|
225
|
+
if (ts.isClassExpression(e))
|
|
226
|
+
return checkedMixinBase(L, arg, L.lowerClassExpressionInfo(e));
|
|
227
|
+
if (ts.isIdentifier(e)) {
|
|
228
|
+
const sym = L.resolveValueSymbol(e);
|
|
229
|
+
const builtin = L.builtinErrorInfoOf(sym) ?? L.builtinEmitterInfoOf(sym) ?? builtinStreamInfoOf(L, sym);
|
|
230
|
+
if (builtin) {
|
|
231
|
+
L.unsupported("SC1090", arg, `mixins over the builtin class '${e.text}' (its construction is libCall-shaped — only program classes compose)`);
|
|
232
|
+
}
|
|
233
|
+
const direct = (sym ? L.classBySymbol.get(sym) : undefined) ??
|
|
234
|
+
propertyAssignedClassInfoOf(L, sym) ??
|
|
235
|
+
exactClassOfReceiver(L, e) ??
|
|
236
|
+
// A const holding a mixin RESULT declared earlier (`const A = M(B);
|
|
237
|
+
// class D extends M2(A) {}`): the binding pins that call's
|
|
238
|
+
// instantiation — collected on demand, registered so every later
|
|
239
|
+
// path answers like a declaration (collectGlobals does the same).
|
|
240
|
+
mixinResultBindingClassOf(L, sym);
|
|
241
|
+
if (direct)
|
|
242
|
+
return checkedMixinBase(L, arg, direct);
|
|
243
|
+
}
|
|
244
|
+
L.unsupported("SC1090", arg, "mixin arguments that are not statically one program class (the compiled mixin monomorphizes per concrete base)");
|
|
245
|
+
}
|
|
246
|
+
/** Argument classes the classval story cannot carry compose-fences. */
|
|
247
|
+
function checkedMixinBase(L, blame, info) {
|
|
248
|
+
if (info.builtinError || info.builtinEmitter || info.builtinStream) {
|
|
249
|
+
L.unsupported("SC1090", blame, `mixins over the builtin class '${info.def.jsName || info.def.name}' (its construction is libCall-shaped — only program classes compose)`);
|
|
250
|
+
}
|
|
251
|
+
if (info.generic) {
|
|
252
|
+
L.unsupported("SC1090", blame, "mixins over a generic class family (pass a concrete class)");
|
|
253
|
+
}
|
|
254
|
+
if (info.classDecorators?.valueGlobalId !== undefined) {
|
|
255
|
+
L.unsupported("SC1090", blame, "mixins over a decorated class (its decorators may replace it — the runtime base would be the decoration result)");
|
|
256
|
+
}
|
|
257
|
+
return info;
|
|
258
|
+
}
|
|
259
|
+
/** A const binding whose initializer is a mixin call: the binding pins
|
|
260
|
+
* exactly that instantiation. Registers classBySymbol on success so every
|
|
261
|
+
* downstream path (construction, statics, extends, instanceof, reads)
|
|
262
|
+
* answers like a declaration from then on. */
|
|
263
|
+
export function mixinResultBindingClassOf(L, sym) {
|
|
264
|
+
if (!sym)
|
|
265
|
+
return null;
|
|
266
|
+
const decls = L.checker.declarationsOf(sym);
|
|
267
|
+
if (decls.length !== 1 || decls[0] === undefined || !ts.isVariableDeclaration(decls[0]))
|
|
268
|
+
return null;
|
|
269
|
+
const decl = decls[0];
|
|
270
|
+
if (!ts.isIdentifier(decl.name) || decl.initializer === undefined ||
|
|
271
|
+
!ts.isVariableDeclarationList(decl.parent) ||
|
|
272
|
+
(decl.parent.flags & ts.NodeFlags.Const) === 0) {
|
|
273
|
+
return null;
|
|
274
|
+
}
|
|
275
|
+
const init = unparen(decl.initializer);
|
|
276
|
+
if (!ts.isCallExpression(init))
|
|
277
|
+
return null;
|
|
278
|
+
const info = mixinCallClassInfoOf(L, init);
|
|
279
|
+
if (info)
|
|
280
|
+
L.classBySymbol.set(sym, info);
|
|
281
|
+
return info;
|
|
282
|
+
}
|
|
283
|
+
/** The heart: the ClassInfo a mixin CALL mints — one instantiation per
|
|
284
|
+
* call site, cached by node (idempotent across the discovery/emit passes'
|
|
285
|
+
* repeated demands from heritage clauses, const bindings, and the call
|
|
286
|
+
* expression's own lowering). Null when the callee is NOT a mixin
|
|
287
|
+
* function (the caller's own machinery and fences answer); every failure
|
|
288
|
+
* PAST recognition is a named diagnostic + poison. */
|
|
289
|
+
export function mixinCallClassInfoOf(L, call) {
|
|
290
|
+
const cached = L.mixinInstanceByCall.get(call);
|
|
291
|
+
if (cached !== undefined) {
|
|
292
|
+
if (cached === null) {
|
|
293
|
+
// The first demand's diagnostics may have deferred under a class
|
|
294
|
+
// symbol nothing flushed — this site still needs a hard answer.
|
|
295
|
+
L.unsupported("SC1090", call, "this mixin call (its instantiation failed to collect — see the instantiation's own diagnostics)");
|
|
296
|
+
}
|
|
297
|
+
return cached;
|
|
298
|
+
}
|
|
299
|
+
const shape = mixinFnOfCallee(L, call.expression);
|
|
300
|
+
if (!shape)
|
|
301
|
+
return null;
|
|
302
|
+
try {
|
|
303
|
+
const info = instantiateMixinCall(L, call, shape);
|
|
304
|
+
L.mixinInstanceByCall.set(call, info);
|
|
305
|
+
return info;
|
|
306
|
+
}
|
|
307
|
+
catch (e) {
|
|
308
|
+
if (e instanceof PoisonError)
|
|
309
|
+
L.mixinInstanceByCall.set(call, null);
|
|
310
|
+
throw e;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
function instantiateMixinCall(L, call, shape) {
|
|
314
|
+
// Reentrancy backstop: a cyclic base chain through const bindings would
|
|
315
|
+
// re-enter its own instantiation (the tsc gate rejects the cycles it
|
|
316
|
+
// sees; this turns anything it misses into a diagnostic, the
|
|
317
|
+
// class-expression rule).
|
|
318
|
+
if (L.mixinCollectingCalls.has(call)) {
|
|
319
|
+
L.unsupported("SC1090", call, "mixin calls whose base chain re-enters their own instantiation (a cyclic extends)");
|
|
320
|
+
}
|
|
321
|
+
if (call.arguments.length !== 1 || ts.isSpreadElement(call.arguments[0])) {
|
|
322
|
+
L.unsupported("SC1090", call, "mixin calls with anything but exactly one direct class argument");
|
|
323
|
+
}
|
|
324
|
+
// Evaluation-position fence: one immortal class object is exact only
|
|
325
|
+
// for once-evaluated calls. Function bodies (and class members) may run
|
|
326
|
+
// any number of times; a class ancestor is legal exactly when the path
|
|
327
|
+
// enters through its heritage clause (the extends expression of a
|
|
328
|
+
// once-evaluated declaration).
|
|
329
|
+
let prev = call;
|
|
330
|
+
for (let p = call.parent; !ts.isSourceFile(p); prev = p, p = p.parent) {
|
|
331
|
+
if (ts.isFunctionLike(p) || ts.isClassStaticBlockDeclaration(p)) {
|
|
332
|
+
L.unsupported("SC1090", call, "mixin calls inside functions (each call mints a DISTINCT class in JS — call the mixin at top level and bind or extend the result)");
|
|
333
|
+
}
|
|
334
|
+
if ((ts.isClassDeclaration(p) || ts.isClassExpression(p)) && !ts.isHeritageClause(prev)) {
|
|
335
|
+
L.unsupported("SC1090", call, "mixin calls inside class members (they evaluate per instance/access — call the mixin at top level)");
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
const base = mixinBaseClassOf(L, call.arguments[0]);
|
|
339
|
+
const instName = L.qualify(call.getSourceFile(), `%mx${call.getStart()}.${shape.classNode.name?.text ?? ""}`);
|
|
340
|
+
const ordinal = L.mixinOrdinals.get(shape.classNode) ?? 0;
|
|
341
|
+
L.mixinOrdinals.set(shape.classNode, ordinal + 1);
|
|
342
|
+
const bindings = new Map();
|
|
343
|
+
if (shape.paramTypeParam) {
|
|
344
|
+
bindings.set(shape.paramTypeParam, { kind: "classval", className: base.def.name });
|
|
345
|
+
}
|
|
346
|
+
const context = `instantiating mixin '${shape.name}' over '${base.def.jsName || base.def.name}'`;
|
|
347
|
+
const prevBindings = L.typeParamBindings;
|
|
348
|
+
const prevContext = L.instantiationContext;
|
|
349
|
+
const prevMixinCtx = L.mixinTypeContext;
|
|
350
|
+
L.typeParamBindings = bindings;
|
|
351
|
+
L.instantiationContext = context;
|
|
352
|
+
L.mixinTypeContext = { classNode: shape.classNode, className: instName };
|
|
353
|
+
L.mixinCollectingCalls.add(call);
|
|
354
|
+
try {
|
|
355
|
+
L.collectClassShapeInner(shape.classNode, undefined, undefined, {
|
|
356
|
+
base,
|
|
357
|
+
name: instName,
|
|
358
|
+
call,
|
|
359
|
+
bindings,
|
|
360
|
+
context,
|
|
361
|
+
ordinal,
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
finally {
|
|
365
|
+
L.typeParamBindings = prevBindings;
|
|
366
|
+
L.instantiationContext = prevContext;
|
|
367
|
+
L.mixinTypeContext = prevMixinCtx;
|
|
368
|
+
L.mixinCollectingCalls.delete(call);
|
|
369
|
+
}
|
|
370
|
+
const info = L.classes.get(instName);
|
|
371
|
+
if (!info)
|
|
372
|
+
throw new PoisonError(); // collection poisoned and reported
|
|
373
|
+
// Members lower in the shared monomorphization fixpoint (demand-driven,
|
|
374
|
+
// like generic-class instantiations — never wantBody-gated).
|
|
375
|
+
L.genericClassInstances.push(info);
|
|
376
|
+
L.onLateClassCollected?.(info);
|
|
377
|
+
// Pinned-position instantiations join the intersection resolver's
|
|
378
|
+
// registry (mixinIntersectionInstanceType).
|
|
379
|
+
if (pinnedMixinCallPosition(call)) {
|
|
380
|
+
const list = L.mixinInstancesByClassNode.get(shape.classNode) ?? [];
|
|
381
|
+
list.push(info);
|
|
382
|
+
L.mixinInstancesByClassNode.set(shape.classNode, list);
|
|
383
|
+
}
|
|
384
|
+
// Statics are declaration-time code: they run when THIS call evaluates.
|
|
385
|
+
// The supported positions put that point at one top-level statement of
|
|
386
|
+
// the call's file — lowerFileInit's positional merge emits them there
|
|
387
|
+
// (before the statement; every allowed shape evaluates nothing
|
|
388
|
+
// observable ahead of the call). Anything subtler is a named fence,
|
|
389
|
+
// never a reordering.
|
|
390
|
+
if (info.staticFields.length > 0 || (info.staticBlocks?.length ?? 0) > 0) {
|
|
391
|
+
const holder = staticsEvalStatementOf(call);
|
|
392
|
+
if (!holder) {
|
|
393
|
+
L.unsupported("SC1090", call, "mixin classes with static members outside a plain top-level position (their declaration-time code must run exactly where the call evaluates — bind the result in its own top-level `const X = M(Base)` statement, or extend the call directly in a top-level class declaration)");
|
|
394
|
+
}
|
|
395
|
+
if (info.mixinInstance) {
|
|
396
|
+
info.mixinInstance.statics = { sf: call.getSourceFile(), pos: holder.getStart() };
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return info;
|
|
400
|
+
}
|
|
401
|
+
/** MIXIN instance intersections — `Tagged.C & Derived`, the checker's
|
|
402
|
+
* type for values built THROUGH a mixin result (`new Thing1(...)` — the
|
|
403
|
+
* inner class node is one shared AST, so its bare reference cannot name a
|
|
404
|
+
* call site). The chain structure disambiguates: the intersection lists
|
|
405
|
+
* the head class plus every mixin layer and the concrete base(s) below
|
|
406
|
+
* it, so an instantiation matches exactly when its mixin-instance
|
|
407
|
+
* ancestors' class NODES are the other mixin parts' nodes (multiset) and
|
|
408
|
+
* every plain-class part sits in its base chain. A unique match answers
|
|
409
|
+
* that instantiation's object type — layout-true by construction (same
|
|
410
|
+
* source, same base chain). Anything ambiguous (two same-shaped
|
|
411
|
+
* instantiations — where picking one could mis-devirtualize against the
|
|
412
|
+
* other's subtree) stays honestly unmapped, and the per-site SC2001
|
|
413
|
+
* names the type. Only instantiations from PINNED positions (const
|
|
414
|
+
* bindings, heritage clauses) participate: they are registered before
|
|
415
|
+
* any body lowers in BOTH passes, so discovery and emit answer alike. */
|
|
416
|
+
export function mixinIntersectionInstanceType(L, widened) {
|
|
417
|
+
const parts = widened.isIntersectionType() ? widened.getTypes() : null;
|
|
418
|
+
if (!parts || L.mixinInstancesByClassNode.size === 0)
|
|
419
|
+
return null;
|
|
420
|
+
const mixinParts = [];
|
|
421
|
+
const plainParts = [];
|
|
422
|
+
for (const part of parts) {
|
|
423
|
+
const sym = part.getSymbol();
|
|
424
|
+
const decl = sym ? L.checker.valueDeclarationOf(sym) : undefined;
|
|
425
|
+
const node = decl && (ts.isClassDeclaration(decl) || ts.isClassExpression(decl)) &&
|
|
426
|
+
L.mixinInstancesByClassNode.has(decl)
|
|
427
|
+
? decl
|
|
428
|
+
: null;
|
|
429
|
+
if (node) {
|
|
430
|
+
// The STATIC side of a mixin class in an intersection (a construct
|
|
431
|
+
// signature) is not an instance part — decline the whole shape.
|
|
432
|
+
if (L.checker.getConstructSignatures(part).length > 0)
|
|
433
|
+
return null;
|
|
434
|
+
mixinParts.push(node);
|
|
435
|
+
continue;
|
|
436
|
+
}
|
|
437
|
+
const mapped = L.mapTypeOf(part);
|
|
438
|
+
if (mapped?.kind !== "object")
|
|
439
|
+
return null;
|
|
440
|
+
plainParts.push(mapped.className);
|
|
441
|
+
}
|
|
442
|
+
if (mixinParts.length === 0)
|
|
443
|
+
return null;
|
|
444
|
+
// Try each mixin part as the HEAD (the most-derived layer): a candidate
|
|
445
|
+
// instantiation of its node matches when the OTHER mixin parts' nodes
|
|
446
|
+
// are exactly its mixin ancestors' nodes and the plain parts all sit in
|
|
447
|
+
// its chain.
|
|
448
|
+
const matches = [];
|
|
449
|
+
for (let h = 0; h < mixinParts.length; h++) {
|
|
450
|
+
const restNodes = mixinParts.filter((_, i) => i !== h);
|
|
451
|
+
for (const cand of L.mixinInstancesByClassNode.get(mixinParts[h]) ?? []) {
|
|
452
|
+
// The candidate's structure: its mixin ancestors' class NODES, and
|
|
453
|
+
// the plain classes ANCHORING each mixin layer (the direct base
|
|
454
|
+
// where a layer sits on a named class) — exactly what the checker
|
|
455
|
+
// flattens into the intersection, so both sides must agree exactly
|
|
456
|
+
// (`Audited & Linked & Node2` matches the Node2-anchored chain, not
|
|
457
|
+
// the Fussy-anchored one whose deeper chain merely CONTAINS Node2).
|
|
458
|
+
const ancestorNodes = [];
|
|
459
|
+
const anchors = new Set();
|
|
460
|
+
for (let c = cand; c; c = c.base) {
|
|
461
|
+
if (!c.mixinInstance)
|
|
462
|
+
break;
|
|
463
|
+
if (c !== cand && c.decl)
|
|
464
|
+
ancestorNodes.push(c.decl);
|
|
465
|
+
if (c.base && !c.base.mixinInstance)
|
|
466
|
+
anchors.add(c.base.def.name);
|
|
467
|
+
}
|
|
468
|
+
if (ancestorNodes.length !== restNodes.length)
|
|
469
|
+
continue;
|
|
470
|
+
const pool = [...ancestorNodes];
|
|
471
|
+
const multisetEq = restNodes.every((n) => {
|
|
472
|
+
const i = pool.indexOf(n);
|
|
473
|
+
if (i < 0)
|
|
474
|
+
return false;
|
|
475
|
+
pool.splice(i, 1);
|
|
476
|
+
return true;
|
|
477
|
+
});
|
|
478
|
+
if (!multisetEq)
|
|
479
|
+
continue;
|
|
480
|
+
const plainSet = new Set(plainParts);
|
|
481
|
+
if (plainSet.size !== anchors.size || ![...plainSet].every((c) => anchors.has(c)))
|
|
482
|
+
continue;
|
|
483
|
+
if (!matches.includes(cand))
|
|
484
|
+
matches.push(cand);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
return matches.length === 1 ? { kind: "object", className: matches[0].def.name } : null;
|
|
488
|
+
}
|
|
489
|
+
/** True when a mixin call sits in a PINNED position — a const binding's
|
|
490
|
+
* initializer or a heritage clause (possibly through other mixin-call
|
|
491
|
+
* argument slots): such instantiations register before any body lowers in
|
|
492
|
+
* both passes, so the intersection resolver above may name them without
|
|
493
|
+
* discovery/emit drift. */
|
|
494
|
+
function pinnedMixinCallPosition(call) {
|
|
495
|
+
let n = call;
|
|
496
|
+
for (let p = n.parent; !ts.isSourceFile(p); n = p, p = p.parent) {
|
|
497
|
+
if (ts.isParenthesizedExpression(p))
|
|
498
|
+
continue;
|
|
499
|
+
if (ts.isCallExpression(p) && p.arguments.length === 1 && p.arguments[0] === n)
|
|
500
|
+
continue;
|
|
501
|
+
if (ts.isVariableDeclaration(p) && p.initializer === n) {
|
|
502
|
+
return ts.isVariableDeclarationList(p.parent) && (p.parent.flags & ts.NodeFlags.Const) !== 0;
|
|
503
|
+
}
|
|
504
|
+
return ts.isExpressionWithTypeArguments(p) && ts.isHeritageClause(p.parent);
|
|
505
|
+
}
|
|
506
|
+
return false;
|
|
507
|
+
}
|
|
508
|
+
/** The top-level statement whose evaluation IS a statics-bearing mixin
|
|
509
|
+
* call's evaluation point, or null: the path from the call to the source
|
|
510
|
+
* file may cross only parens, enclosing mixin-call argument positions,
|
|
511
|
+
* a sole-declarator top-level variable statement, a bare expression
|
|
512
|
+
* statement, or a top-level class declaration's heritage clause. */
|
|
513
|
+
function staticsEvalStatementOf(call) {
|
|
514
|
+
let n = call;
|
|
515
|
+
for (let p = n.parent;; n = p, p = p.parent) {
|
|
516
|
+
if (ts.isParenthesizedExpression(p))
|
|
517
|
+
continue;
|
|
518
|
+
if (ts.isCallExpression(p) && p.arguments.length === 1 && p.arguments[0] === n)
|
|
519
|
+
continue;
|
|
520
|
+
if (ts.isVariableDeclaration(p) && p.initializer === n &&
|
|
521
|
+
ts.isVariableDeclarationList(p.parent) && p.parent.declarations.length === 1 &&
|
|
522
|
+
ts.isVariableStatement(p.parent.parent) && ts.isSourceFile(p.parent.parent.parent)) {
|
|
523
|
+
return p.parent.parent;
|
|
524
|
+
}
|
|
525
|
+
if (ts.isExpressionStatement(p) && ts.isSourceFile(p.parent))
|
|
526
|
+
return p;
|
|
527
|
+
if (ts.isExpressionWithTypeArguments(p) || ts.isHeritageClause(p))
|
|
528
|
+
continue;
|
|
529
|
+
if (ts.isClassDeclaration(p) && ts.isSourceFile(p.parent) && ts.isHeritageClause(n))
|
|
530
|
+
return p;
|
|
531
|
+
return null;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
//# sourceMappingURL=lower-mixins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lower-mixins.js","sourceRoot":"","sources":["../../../src/frontend/lowering/lower-mixins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmCiB;AACjB,OAAO,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAa,mBAAmB,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AA6CvH,0BAA0B;AAC1B,SAAS,OAAO,CAAC,CAAgB;IAC/B,OAAO,EAAE,CAAC,yBAAyB,CAA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