@tsonic/emitter 0.0.74 → 0.0.75
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/.tsbuildinfo +1 -1
- package/dist/array.test.js +277 -6
- package/dist/array.test.js.map +1 -1
- package/dist/core/format/attributes.d.ts +3 -3
- package/dist/core/format/attributes.js +3 -3
- package/dist/core/format/backend-ast/builders.d.ts +1 -0
- package/dist/core/format/backend-ast/builders.d.ts.map +1 -1
- package/dist/core/format/backend-ast/builders.js +44 -22
- package/dist/core/format/backend-ast/builders.js.map +1 -1
- package/dist/core/format/backend-ast/invariants.test.js +15 -8
- package/dist/core/format/backend-ast/invariants.test.js.map +1 -1
- package/dist/core/format/backend-ast/printer-cases/basic-and-declarations.test.d.ts +2 -0
- package/dist/core/format/backend-ast/printer-cases/basic-and-declarations.test.d.ts.map +1 -0
- package/dist/core/format/backend-ast/printer-cases/basic-and-declarations.test.js +226 -0
- package/dist/core/format/backend-ast/printer-cases/basic-and-declarations.test.js.map +1 -0
- package/dist/core/format/backend-ast/printer-cases/control-flow-and-switch.test.d.ts +2 -0
- package/dist/core/format/backend-ast/printer-cases/control-flow-and-switch.test.d.ts.map +1 -0
- package/dist/core/format/backend-ast/printer-cases/control-flow-and-switch.test.js +289 -0
- package/dist/core/format/backend-ast/printer-cases/control-flow-and-switch.test.js.map +1 -0
- package/dist/core/format/backend-ast/printer-cases/helpers.d.ts +6 -0
- package/dist/core/format/backend-ast/printer-cases/helpers.d.ts.map +1 -0
- package/dist/core/format/backend-ast/printer-cases/helpers.js +5 -0
- package/dist/core/format/backend-ast/printer-cases/helpers.js.map +1 -0
- package/dist/core/format/backend-ast/printer-cases/identifiers-and-interpolation.test.d.ts +2 -0
- package/dist/core/format/backend-ast/printer-cases/identifiers-and-interpolation.test.d.ts.map +1 -0
- package/dist/core/format/backend-ast/printer-cases/identifiers-and-interpolation.test.js +211 -0
- package/dist/core/format/backend-ast/printer-cases/identifiers-and-interpolation.test.js.map +1 -0
- package/dist/core/format/backend-ast/printer-cases/remaining-nodes.test.d.ts +2 -0
- package/dist/core/format/backend-ast/printer-cases/remaining-nodes.test.d.ts.map +1 -0
- package/dist/core/format/backend-ast/printer-cases/remaining-nodes.test.js +186 -0
- package/dist/core/format/backend-ast/printer-cases/remaining-nodes.test.js.map +1 -0
- package/dist/core/format/backend-ast/printer-colon-detection.d.ts +14 -0
- package/dist/core/format/backend-ast/printer-colon-detection.d.ts.map +1 -0
- package/dist/core/format/backend-ast/printer-colon-detection.js +141 -0
- package/dist/core/format/backend-ast/printer-colon-detection.js.map +1 -0
- package/dist/core/format/backend-ast/printer-declarations.d.ts +12 -0
- package/dist/core/format/backend-ast/printer-declarations.d.ts.map +1 -0
- package/dist/core/format/backend-ast/printer-declarations.js +212 -0
- package/dist/core/format/backend-ast/printer-declarations.js.map +1 -0
- package/dist/core/format/backend-ast/printer-expressions.d.ts +12 -0
- package/dist/core/format/backend-ast/printer-expressions.d.ts.map +1 -0
- package/dist/core/format/backend-ast/printer-expressions.js +363 -0
- package/dist/core/format/backend-ast/printer-expressions.js.map +1 -0
- package/dist/core/format/backend-ast/printer-identifiers.d.ts +31 -0
- package/dist/core/format/backend-ast/printer-identifiers.d.ts.map +1 -0
- package/dist/core/format/backend-ast/printer-identifiers.js +194 -0
- package/dist/core/format/backend-ast/printer-identifiers.js.map +1 -0
- package/dist/core/format/backend-ast/printer-precedence.d.ts +23 -0
- package/dist/core/format/backend-ast/printer-precedence.d.ts.map +1 -0
- package/dist/core/format/backend-ast/printer-precedence.js +225 -0
- package/dist/core/format/backend-ast/printer-precedence.js.map +1 -0
- package/dist/core/format/backend-ast/printer-shared.d.ts +12 -0
- package/dist/core/format/backend-ast/printer-shared.d.ts.map +1 -0
- package/dist/core/format/backend-ast/printer-shared.js +12 -0
- package/dist/core/format/backend-ast/printer-shared.js.map +1 -0
- package/dist/core/format/backend-ast/printer-statements.d.ts +24 -0
- package/dist/core/format/backend-ast/printer-statements.d.ts.map +1 -0
- package/dist/core/format/backend-ast/printer-statements.js +336 -0
- package/dist/core/format/backend-ast/printer-statements.js.map +1 -0
- package/dist/core/format/backend-ast/printer.d.ts +10 -23
- package/dist/core/format/backend-ast/printer.d.ts.map +1 -1
- package/dist/core/format/backend-ast/printer.js +11 -1389
- package/dist/core/format/backend-ast/printer.js.map +1 -1
- package/dist/core/format/backend-ast/printer.test.d.ts +4 -1
- package/dist/core/format/backend-ast/printer.test.d.ts.map +1 -1
- package/dist/core/format/backend-ast/printer.test.js +4 -795
- package/dist/core/format/backend-ast/printer.test.js.map +1 -1
- package/dist/core/format/backend-ast/types/compilation-unit-ast.d.ts +26 -0
- package/dist/core/format/backend-ast/types/compilation-unit-ast.d.ts.map +1 -0
- package/dist/core/format/backend-ast/types/compilation-unit-ast.js +2 -0
- package/dist/core/format/backend-ast/types/compilation-unit-ast.js.map +1 -0
- package/dist/core/format/backend-ast/types/declaration-ast.d.ts +105 -0
- package/dist/core/format/backend-ast/types/declaration-ast.d.ts.map +1 -0
- package/dist/core/format/backend-ast/types/declaration-ast.js +2 -0
- package/dist/core/format/backend-ast/types/declaration-ast.js.map +1 -0
- package/dist/core/format/backend-ast/types/expression-ast.d.ts +219 -0
- package/dist/core/format/backend-ast/types/expression-ast.d.ts.map +1 -0
- package/dist/core/format/backend-ast/types/expression-ast.js +2 -0
- package/dist/core/format/backend-ast/types/expression-ast.js.map +1 -0
- package/dist/core/format/backend-ast/types/pattern-ast.d.ts +28 -0
- package/dist/core/format/backend-ast/types/pattern-ast.d.ts.map +1 -0
- package/dist/core/format/backend-ast/types/pattern-ast.js +2 -0
- package/dist/core/format/backend-ast/types/pattern-ast.js.map +1 -0
- package/dist/core/format/backend-ast/types/signature-ast.d.ts +34 -0
- package/dist/core/format/backend-ast/types/signature-ast.d.ts.map +1 -0
- package/dist/core/format/backend-ast/types/signature-ast.js +2 -0
- package/dist/core/format/backend-ast/types/signature-ast.js.map +1 -0
- package/dist/core/format/backend-ast/types/statement-ast.d.ts +118 -0
- package/dist/core/format/backend-ast/types/statement-ast.d.ts.map +1 -0
- package/dist/core/format/backend-ast/types/statement-ast.js +2 -0
- package/dist/core/format/backend-ast/types/statement-ast.js.map +1 -0
- package/dist/core/format/backend-ast/types/type-ast.d.ts +50 -0
- package/dist/core/format/backend-ast/types/type-ast.d.ts.map +1 -0
- package/dist/core/format/backend-ast/types/type-ast.js +2 -0
- package/dist/core/format/backend-ast/types/type-ast.js.map +1 -0
- package/dist/core/format/backend-ast/types.d.ts +7 -549
- package/dist/core/format/backend-ast/types.d.ts.map +1 -1
- package/dist/core/format/backend-ast/types.js +7 -1
- package/dist/core/format/backend-ast/types.js.map +1 -1
- package/dist/core/format/backend-ast/utils.d.ts +4 -0
- package/dist/core/format/backend-ast/utils.d.ts.map +1 -1
- package/dist/core/format/backend-ast/utils.js +87 -16
- package/dist/core/format/backend-ast/utils.js.map +1 -1
- package/dist/core/format/backend-ast/utils.test.js +67 -4
- package/dist/core/format/backend-ast/utils.test.js.map +1 -1
- package/dist/core/format/local-names.d.ts +26 -0
- package/dist/core/format/local-names.d.ts.map +1 -1
- package/dist/core/format/local-names.js +59 -0
- package/dist/core/format/local-names.js.map +1 -1
- package/dist/core/format/local-names.test.d.ts +12 -0
- package/dist/core/format/local-names.test.d.ts.map +1 -0
- package/dist/core/format/local-names.test.js +278 -0
- package/dist/core/format/local-names.test.js.map +1 -0
- package/dist/core/format/module-emitter/orchestrator.d.ts.map +1 -1
- package/dist/core/format/module-emitter/orchestrator.js +1 -152
- package/dist/core/format/module-emitter/orchestrator.js.map +1 -1
- package/dist/core/format/module-emitter/static-container.d.ts.map +1 -1
- package/dist/core/format/module-emitter/static-container.js +17 -1
- package/dist/core/format/module-emitter/static-container.js.map +1 -1
- package/dist/core/module-emitter-cases/class-and-recursion.test.d.ts +6 -0
- package/dist/core/module-emitter-cases/class-and-recursion.test.d.ts.map +1 -0
- package/dist/core/module-emitter-cases/class-and-recursion.test.js +263 -0
- package/dist/core/module-emitter-cases/class-and-recursion.test.js.map +1 -0
- package/dist/core/module-emitter-cases/static-containers.test.d.ts +6 -0
- package/dist/core/module-emitter-cases/static-containers.test.d.ts.map +1 -0
- package/dist/core/module-emitter-cases/static-containers.test.js +275 -0
- package/dist/core/module-emitter-cases/static-containers.test.js.map +1 -0
- package/dist/core/module-emitter.test.d.ts +2 -5
- package/dist/core/module-emitter.test.d.ts.map +1 -1
- package/dist/core/module-emitter.test.js +2 -403
- package/dist/core/module-emitter.test.js.map +1 -1
- package/dist/core/semantic/array-expected-types.d.ts +6 -0
- package/dist/core/semantic/array-expected-types.d.ts.map +1 -0
- package/dist/core/semantic/array-expected-types.js +84 -0
- package/dist/core/semantic/array-expected-types.js.map +1 -0
- package/dist/core/semantic/array-expected-types.test.d.ts +2 -0
- package/dist/core/semantic/array-expected-types.test.d.ts.map +1 -0
- package/dist/core/semantic/array-expected-types.test.js +66 -0
- package/dist/core/semantic/array-expected-types.test.js.map +1 -0
- package/dist/core/semantic/assignment-flow.d.ts +9 -0
- package/dist/core/semantic/assignment-flow.d.ts.map +1 -0
- package/dist/core/semantic/assignment-flow.js +161 -0
- package/dist/core/semantic/assignment-flow.js.map +1 -0
- package/dist/core/semantic/async-wrapper-types.d.ts +6 -0
- package/dist/core/semantic/async-wrapper-types.d.ts.map +1 -0
- package/dist/core/semantic/async-wrapper-types.js +65 -0
- package/dist/core/semantic/async-wrapper-types.js.map +1 -0
- package/dist/core/semantic/boolean-condition-emission.d.ts +9 -0
- package/dist/core/semantic/boolean-condition-emission.d.ts.map +1 -0
- package/dist/core/semantic/boolean-condition-emission.js +9 -0
- package/dist/core/semantic/boolean-condition-emission.js.map +1 -0
- package/dist/core/semantic/boolean-condition-main.d.ts +38 -0
- package/dist/core/semantic/boolean-condition-main.d.ts.map +1 -0
- package/dist/core/semantic/boolean-condition-main.js +235 -0
- package/dist/core/semantic/boolean-condition-main.js.map +1 -0
- package/dist/core/semantic/boolean-condition-union.d.ts +20 -0
- package/dist/core/semantic/boolean-condition-union.d.ts.map +1 -0
- package/dist/core/semantic/boolean-condition-union.js +238 -0
- package/dist/core/semantic/boolean-condition-union.js.map +1 -0
- package/dist/core/semantic/boolean-context.d.ts +6 -40
- package/dist/core/semantic/boolean-context.d.ts.map +1 -1
- package/dist/core/semantic/boolean-context.js +6 -709
- package/dist/core/semantic/boolean-context.js.map +1 -1
- package/dist/core/semantic/boolean-context.test.js +22 -2
- package/dist/core/semantic/boolean-context.test.js.map +1 -1
- package/dist/core/semantic/broad-array-storage.d.ts +11 -0
- package/dist/core/semantic/broad-array-storage.d.ts.map +1 -0
- package/dist/core/semantic/broad-array-storage.js +111 -0
- package/dist/core/semantic/broad-array-storage.js.map +1 -0
- package/dist/core/semantic/broad-object-types.d.ts +7 -0
- package/dist/core/semantic/broad-object-types.d.ts.map +1 -0
- package/dist/core/semantic/broad-object-types.js +60 -0
- package/dist/core/semantic/broad-object-types.js.map +1 -0
- package/dist/core/semantic/clr-type-identity.d.ts +21 -0
- package/dist/core/semantic/clr-type-identity.d.ts.map +1 -0
- package/dist/core/semantic/clr-type-identity.js +230 -0
- package/dist/core/semantic/clr-type-identity.js.map +1 -0
- package/dist/core/semantic/comparable-types.d.ts +5 -0
- package/dist/core/semantic/comparable-types.d.ts.map +1 -0
- package/dist/core/semantic/comparable-types.js +108 -0
- package/dist/core/semantic/comparable-types.js.map +1 -0
- package/dist/core/semantic/comparable-types.test.d.ts +2 -0
- package/dist/core/semantic/comparable-types.test.d.ts.map +1 -0
- package/dist/core/semantic/comparable-types.test.js +199 -0
- package/dist/core/semantic/comparable-types.test.js.map +1 -0
- package/dist/core/semantic/condition-branch-narrowing.d.ts +6 -0
- package/dist/core/semantic/condition-branch-narrowing.d.ts.map +1 -0
- package/dist/core/semantic/condition-branch-narrowing.js +50 -0
- package/dist/core/semantic/condition-branch-narrowing.js.map +1 -0
- package/dist/core/semantic/defaults.d.ts +7 -0
- package/dist/core/semantic/defaults.d.ts.map +1 -0
- package/dist/core/semantic/defaults.js +61 -0
- package/dist/core/semantic/defaults.js.map +1 -0
- package/dist/core/semantic/defaults.test.d.ts +2 -0
- package/dist/core/semantic/defaults.test.d.ts.map +1 -0
- package/dist/core/semantic/defaults.test.js +88 -0
- package/dist/core/semantic/defaults.test.js.map +1 -0
- package/dist/core/semantic/deterministic-type-keys.d.ts +8 -0
- package/dist/core/semantic/deterministic-type-keys.d.ts.map +1 -0
- package/dist/core/semantic/deterministic-type-keys.js +277 -0
- package/dist/core/semantic/deterministic-type-keys.js.map +1 -0
- package/dist/core/semantic/direct-storage-ir-types.d.ts +12 -0
- package/dist/core/semantic/direct-storage-ir-types.d.ts.map +1 -0
- package/dist/core/semantic/direct-storage-ir-types.js +189 -0
- package/dist/core/semantic/direct-storage-ir-types.js.map +1 -0
- package/dist/core/semantic/direct-value-surfaces.d.ts +9 -0
- package/dist/core/semantic/direct-value-surfaces.d.ts.map +1 -0
- package/dist/core/semantic/direct-value-surfaces.js +181 -0
- package/dist/core/semantic/direct-value-surfaces.js.map +1 -0
- package/dist/core/semantic/direct-value-surfaces.test.d.ts +2 -0
- package/dist/core/semantic/direct-value-surfaces.test.d.ts.map +1 -0
- package/dist/core/semantic/direct-value-surfaces.test.js +116 -0
- package/dist/core/semantic/direct-value-surfaces.test.js.map +1 -0
- package/dist/core/semantic/expected-type-matching.d.ts +7 -0
- package/dist/core/semantic/expected-type-matching.d.ts.map +1 -0
- package/dist/core/semantic/expected-type-matching.js +101 -0
- package/dist/core/semantic/expected-type-matching.js.map +1 -0
- package/dist/core/semantic/guard-primitives.d.ts +29 -0
- package/dist/core/semantic/guard-primitives.d.ts.map +1 -0
- package/dist/core/semantic/guard-primitives.js +80 -0
- package/dist/core/semantic/guard-primitives.js.map +1 -0
- package/dist/core/semantic/implicit-interfaces.d.ts +34 -0
- package/dist/core/semantic/implicit-interfaces.d.ts.map +1 -0
- package/dist/core/semantic/implicit-interfaces.js +276 -0
- package/dist/core/semantic/implicit-interfaces.js.map +1 -0
- package/dist/core/semantic/implicit-interfaces.test.d.ts +2 -0
- package/dist/core/semantic/implicit-interfaces.test.d.ts.map +1 -0
- package/dist/core/semantic/implicit-interfaces.test.js +280 -0
- package/dist/core/semantic/implicit-interfaces.test.js.map +1 -0
- package/dist/core/semantic/imports-cases/basic-and-local.test.d.ts +6 -0
- package/dist/core/semantic/imports-cases/basic-and-local.test.d.ts.map +1 -0
- package/dist/core/semantic/imports-cases/basic-and-local.test.js +504 -0
- package/dist/core/semantic/imports-cases/basic-and-local.test.js.map +1 -0
- package/dist/core/semantic/imports-cases/bindings-and-namespaces.test.d.ts +6 -0
- package/dist/core/semantic/imports-cases/bindings-and-namespaces.test.d.ts.map +1 -0
- package/dist/core/semantic/imports-cases/bindings-and-namespaces.test.js +932 -0
- package/dist/core/semantic/imports-cases/bindings-and-namespaces.test.js.map +1 -0
- package/dist/core/semantic/imports.d.ts.map +1 -1
- package/dist/core/semantic/imports.js +158 -22
- package/dist/core/semantic/imports.js.map +1 -1
- package/dist/core/semantic/imports.test.d.ts +2 -5
- package/dist/core/semantic/imports.test.d.ts.map +1 -1
- package/dist/core/semantic/imports.test.js +2 -551
- package/dist/core/semantic/imports.test.js.map +1 -1
- package/dist/core/semantic/instanceof-predicate-refinements.d.ts +10 -0
- package/dist/core/semantic/instanceof-predicate-refinements.d.ts.map +1 -0
- package/dist/core/semantic/instanceof-predicate-refinements.js +189 -0
- package/dist/core/semantic/instanceof-predicate-refinements.js.map +1 -0
- package/dist/core/semantic/instanceof-targets.d.ts +10 -0
- package/dist/core/semantic/instanceof-targets.d.ts.map +1 -0
- package/dist/core/semantic/instanceof-targets.js +20 -0
- package/dist/core/semantic/instanceof-targets.js.map +1 -0
- package/dist/core/semantic/iteration-types.d.ts +11 -0
- package/dist/core/semantic/iteration-types.d.ts.map +1 -0
- package/dist/core/semantic/iteration-types.js +116 -0
- package/dist/core/semantic/iteration-types.js.map +1 -0
- package/dist/core/semantic/js-value-types.d.ts +5 -0
- package/dist/core/semantic/js-value-types.d.ts.map +1 -0
- package/dist/core/semantic/js-value-types.js +42 -0
- package/dist/core/semantic/js-value-types.js.map +1 -0
- package/dist/core/semantic/local-type-lookup.d.ts +8 -0
- package/dist/core/semantic/local-type-lookup.d.ts.map +1 -0
- package/dist/core/semantic/local-type-lookup.js +36 -0
- package/dist/core/semantic/local-type-lookup.js.map +1 -0
- package/dist/core/semantic/local-types.d.ts +1 -0
- package/dist/core/semantic/local-types.d.ts.map +1 -1
- package/dist/core/semantic/local-types.js +269 -0
- package/dist/core/semantic/local-types.js.map +1 -1
- package/dist/core/semantic/materialized-narrowing.d.ts +5 -0
- package/dist/core/semantic/materialized-narrowing.d.ts.map +1 -0
- package/dist/core/semantic/materialized-narrowing.js +361 -0
- package/dist/core/semantic/materialized-narrowing.js.map +1 -0
- package/dist/core/semantic/materialized-narrowing.test.d.ts +2 -0
- package/dist/core/semantic/materialized-narrowing.test.d.ts.map +1 -0
- package/dist/core/semantic/materialized-narrowing.test.js +321 -0
- package/dist/core/semantic/materialized-narrowing.test.js.map +1 -0
- package/dist/core/semantic/member-surfaces.d.ts +10 -0
- package/dist/core/semantic/member-surfaces.d.ts.map +1 -0
- package/dist/core/semantic/member-surfaces.js +108 -0
- package/dist/core/semantic/member-surfaces.js.map +1 -0
- package/dist/core/semantic/member-surfaces.test.d.ts +2 -0
- package/dist/core/semantic/member-surfaces.test.d.ts.map +1 -0
- package/dist/core/semantic/member-surfaces.test.js +105 -0
- package/dist/core/semantic/member-surfaces.test.js.map +1 -0
- package/dist/core/semantic/module-map.d.ts.map +1 -1
- package/dist/core/semantic/module-map.js +92 -2
- package/dist/core/semantic/module-map.js.map +1 -1
- package/dist/core/semantic/module-map.test.js +264 -0
- package/dist/core/semantic/module-map.test.js.map +1 -1
- package/dist/core/semantic/mutable-storage-detection.d.ts +10 -0
- package/dist/core/semantic/mutable-storage-detection.d.ts.map +1 -0
- package/dist/core/semantic/mutable-storage-detection.js +10 -0
- package/dist/core/semantic/mutable-storage-detection.js.map +1 -0
- package/dist/core/semantic/mutable-storage-expression-visitor.d.ts +12 -0
- package/dist/core/semantic/mutable-storage-expression-visitor.d.ts.map +1 -0
- package/dist/core/semantic/mutable-storage-expression-visitor.js +126 -0
- package/dist/core/semantic/mutable-storage-expression-visitor.js.map +1 -0
- package/dist/core/semantic/mutable-storage-helpers.d.ts +26 -0
- package/dist/core/semantic/mutable-storage-helpers.d.ts.map +1 -0
- package/dist/core/semantic/mutable-storage-helpers.js +203 -0
- package/dist/core/semantic/mutable-storage-helpers.js.map +1 -0
- package/dist/core/semantic/mutable-storage-statement-visitor.d.ts +5 -0
- package/dist/core/semantic/mutable-storage-statement-visitor.d.ts.map +1 -0
- package/dist/core/semantic/mutable-storage-statement-visitor.js +158 -0
- package/dist/core/semantic/mutable-storage-statement-visitor.js.map +1 -0
- package/dist/core/semantic/mutable-storage-visitors.d.ts +5 -0
- package/dist/core/semantic/mutable-storage-visitors.d.ts.map +1 -0
- package/dist/core/semantic/mutable-storage-visitors.js +17 -0
- package/dist/core/semantic/mutable-storage-visitors.js.map +1 -0
- package/dist/core/semantic/mutable-storage.d.ts +2 -9
- package/dist/core/semantic/mutable-storage.d.ts.map +1 -1
- package/dist/core/semantic/mutable-storage.js +2 -478
- package/dist/core/semantic/mutable-storage.js.map +1 -1
- package/dist/core/semantic/narrowed-expression-types.d.ts +7 -0
- package/dist/core/semantic/narrowed-expression-types.d.ts.map +1 -0
- package/dist/core/semantic/narrowed-expression-types.js +287 -0
- package/dist/core/semantic/narrowed-expression-types.js.map +1 -0
- package/dist/core/semantic/narrowed-expression-types.test.d.ts +2 -0
- package/dist/core/semantic/narrowed-expression-types.test.d.ts.map +1 -0
- package/dist/core/semantic/narrowed-expression-types.test.js +296 -0
- package/dist/core/semantic/narrowed-expression-types.test.js.map +1 -0
- package/dist/core/semantic/narrowed-union-resolution.d.ts +42 -0
- package/dist/core/semantic/narrowed-union-resolution.d.ts.map +1 -0
- package/dist/core/semantic/narrowed-union-resolution.js +162 -0
- package/dist/core/semantic/narrowed-union-resolution.js.map +1 -0
- package/dist/core/semantic/narrowing-builder-core.d.ts +46 -0
- package/dist/core/semantic/narrowing-builder-core.d.ts.map +1 -0
- package/dist/core/semantic/narrowing-builder-core.js +332 -0
- package/dist/core/semantic/narrowing-builder-core.js.map +1 -0
- package/dist/core/semantic/narrowing-builder-core.test.d.ts +2 -0
- package/dist/core/semantic/narrowing-builder-core.test.d.ts.map +1 -0
- package/dist/core/semantic/narrowing-builder-core.test.js +49 -0
- package/dist/core/semantic/narrowing-builder-core.test.js.map +1 -0
- package/dist/core/semantic/narrowing-builder-unions.d.ts +18 -0
- package/dist/core/semantic/narrowing-builder-unions.d.ts.map +1 -0
- package/dist/core/semantic/narrowing-builder-unions.js +336 -0
- package/dist/core/semantic/narrowing-builder-unions.js.map +1 -0
- package/dist/core/semantic/narrowing-builders.d.ts +10 -0
- package/dist/core/semantic/narrowing-builders.d.ts.map +1 -0
- package/dist/core/semantic/narrowing-builders.js +10 -0
- package/dist/core/semantic/narrowing-builders.js.map +1 -0
- package/dist/core/semantic/narrowing-keys.d.ts +6 -0
- package/dist/core/semantic/narrowing-keys.d.ts.map +1 -0
- package/dist/core/semantic/narrowing-keys.js +27 -0
- package/dist/core/semantic/narrowing-keys.js.map +1 -0
- package/dist/core/semantic/narrowing-refinements.d.ts +10 -0
- package/dist/core/semantic/narrowing-refinements.d.ts.map +1 -0
- package/dist/core/semantic/narrowing-refinements.js +10 -0
- package/dist/core/semantic/narrowing-refinements.js.map +1 -0
- package/dist/core/semantic/nullable-typeof-refinements.d.ts +13 -0
- package/dist/core/semantic/nullable-typeof-refinements.d.ts.map +1 -0
- package/dist/core/semantic/nullable-typeof-refinements.js +408 -0
- package/dist/core/semantic/nullable-typeof-refinements.js.map +1 -0
- package/dist/core/semantic/nullish-value-helpers.d.ts +64 -0
- package/dist/core/semantic/nullish-value-helpers.d.ts.map +1 -0
- package/dist/core/semantic/nullish-value-helpers.js +346 -0
- package/dist/core/semantic/nullish-value-helpers.js.map +1 -0
- package/dist/core/semantic/parameter-modifier-types.d.ts +3 -0
- package/dist/core/semantic/parameter-modifier-types.d.ts.map +1 -0
- package/dist/core/semantic/parameter-modifier-types.js +17 -0
- package/dist/core/semantic/parameter-modifier-types.js.map +1 -0
- package/dist/core/semantic/pattern-types.d.ts +59 -0
- package/dist/core/semantic/pattern-types.d.ts.map +1 -0
- package/dist/core/semantic/pattern-types.js +92 -0
- package/dist/core/semantic/pattern-types.js.map +1 -0
- package/dist/core/semantic/property-lookup-membership.d.ts +30 -0
- package/dist/core/semantic/property-lookup-membership.d.ts.map +1 -0
- package/dist/core/semantic/property-lookup-membership.js +176 -0
- package/dist/core/semantic/property-lookup-membership.js.map +1 -0
- package/dist/core/semantic/property-lookup-resolution.d.ts +52 -0
- package/dist/core/semantic/property-lookup-resolution.d.ts.map +1 -0
- package/dist/core/semantic/property-lookup-resolution.js +275 -0
- package/dist/core/semantic/property-lookup-resolution.js.map +1 -0
- package/dist/core/semantic/property-member-lookup.d.ts +10 -0
- package/dist/core/semantic/property-member-lookup.d.ts.map +1 -0
- package/dist/core/semantic/property-member-lookup.js +10 -0
- package/dist/core/semantic/property-member-lookup.js.map +1 -0
- package/dist/core/semantic/reference-type-identity.d.ts +10 -0
- package/dist/core/semantic/reference-type-identity.d.ts.map +1 -0
- package/dist/core/semantic/reference-type-identity.js +28 -0
- package/dist/core/semantic/reference-type-identity.js.map +1 -0
- package/dist/core/semantic/runtime-call-arities.d.ts +4 -0
- package/dist/core/semantic/runtime-call-arities.d.ts.map +1 -0
- package/dist/core/semantic/runtime-call-arities.js +104 -0
- package/dist/core/semantic/runtime-call-arities.js.map +1 -0
- package/dist/core/semantic/runtime-materialization-targets.d.ts +4 -0
- package/dist/core/semantic/runtime-materialization-targets.d.ts.map +1 -0
- package/dist/core/semantic/runtime-materialization-targets.js +69 -0
- package/dist/core/semantic/runtime-materialization-targets.js.map +1 -0
- package/dist/core/semantic/runtime-reification-helpers.d.ts +9 -0
- package/dist/core/semantic/runtime-reification-helpers.d.ts.map +1 -0
- package/dist/core/semantic/runtime-reification-helpers.js +99 -0
- package/dist/core/semantic/runtime-reification-helpers.js.map +1 -0
- package/dist/core/semantic/runtime-reification.d.ts +16 -0
- package/dist/core/semantic/runtime-reification.d.ts.map +1 -0
- package/dist/core/semantic/runtime-reification.js +609 -0
- package/dist/core/semantic/runtime-reification.js.map +1 -0
- package/dist/core/semantic/runtime-union-alias-identity.d.ts +5 -0
- package/dist/core/semantic/runtime-union-alias-identity.d.ts.map +1 -0
- package/dist/core/semantic/runtime-union-alias-identity.js +27 -0
- package/dist/core/semantic/runtime-union-alias-identity.js.map +1 -0
- package/dist/core/semantic/runtime-union-expansion.d.ts +5 -0
- package/dist/core/semantic/runtime-union-expansion.d.ts.map +1 -0
- package/dist/core/semantic/runtime-union-expansion.js +190 -0
- package/dist/core/semantic/runtime-union-expansion.js.map +1 -0
- package/dist/core/semantic/runtime-union-family-preservation.d.ts +5 -0
- package/dist/core/semantic/runtime-union-family-preservation.d.ts.map +1 -0
- package/dist/core/semantic/runtime-union-family-preservation.js +34 -0
- package/dist/core/semantic/runtime-union-family-preservation.js.map +1 -0
- package/dist/core/semantic/runtime-union-matching.d.ts +9 -0
- package/dist/core/semantic/runtime-union-matching.d.ts.map +1 -0
- package/dist/core/semantic/runtime-union-matching.js +121 -0
- package/dist/core/semantic/runtime-union-matching.js.map +1 -0
- package/dist/core/semantic/runtime-union-member-mapping.d.ts +12 -0
- package/dist/core/semantic/runtime-union-member-mapping.d.ts.map +1 -0
- package/dist/core/semantic/runtime-union-member-mapping.js +25 -0
- package/dist/core/semantic/runtime-union-member-mapping.js.map +1 -0
- package/dist/core/semantic/runtime-union-member-mapping.test.d.ts +2 -0
- package/dist/core/semantic/runtime-union-member-mapping.test.d.ts.map +1 -0
- package/dist/core/semantic/runtime-union-member-mapping.test.js +54 -0
- package/dist/core/semantic/runtime-union-member-mapping.test.js.map +1 -0
- package/dist/core/semantic/runtime-union-ordering.d.ts +4 -0
- package/dist/core/semantic/runtime-union-ordering.d.ts.map +1 -0
- package/dist/core/semantic/runtime-union-ordering.js +114 -0
- package/dist/core/semantic/runtime-union-ordering.js.map +1 -0
- package/dist/core/semantic/runtime-union-projection.d.ts +40 -0
- package/dist/core/semantic/runtime-union-projection.d.ts.map +1 -0
- package/dist/core/semantic/runtime-union-projection.js +150 -0
- package/dist/core/semantic/runtime-union-projection.js.map +1 -0
- package/dist/core/semantic/runtime-union-projection.test.d.ts +2 -0
- package/dist/core/semantic/runtime-union-projection.test.d.ts.map +1 -0
- package/dist/core/semantic/runtime-union-projection.test.js +211 -0
- package/dist/core/semantic/runtime-union-projection.test.js.map +1 -0
- package/dist/core/semantic/runtime-union-registry.d.ts +28 -0
- package/dist/core/semantic/runtime-union-registry.d.ts.map +1 -0
- package/dist/core/semantic/runtime-union-registry.js +301 -0
- package/dist/core/semantic/runtime-union-registry.js.map +1 -0
- package/dist/core/semantic/runtime-union-shared.d.ts +23 -0
- package/dist/core/semantic/runtime-union-shared.d.ts.map +1 -0
- package/dist/core/semantic/runtime-union-shared.js +29 -0
- package/dist/core/semantic/runtime-union-shared.js.map +1 -0
- package/dist/core/semantic/runtime-unions.d.ts +14 -0
- package/dist/core/semantic/runtime-unions.d.ts.map +1 -0
- package/dist/core/semantic/runtime-unions.js +330 -0
- package/dist/core/semantic/runtime-unions.js.map +1 -0
- package/dist/core/semantic/runtime-unions.test.d.ts +2 -0
- package/dist/core/semantic/runtime-unions.test.d.ts.map +1 -0
- package/dist/core/semantic/runtime-unions.test.js +922 -0
- package/dist/core/semantic/runtime-unions.test.js.map +1 -0
- package/dist/core/semantic/semantic-union-members.d.ts +46 -0
- package/dist/core/semantic/semantic-union-members.d.ts.map +1 -0
- package/dist/core/semantic/semantic-union-members.js +144 -0
- package/dist/core/semantic/semantic-union-members.js.map +1 -0
- package/dist/core/semantic/storage-erased-adaptation.d.ts +14 -0
- package/dist/core/semantic/storage-erased-adaptation.d.ts.map +1 -0
- package/dist/core/semantic/storage-erased-adaptation.js +191 -0
- package/dist/core/semantic/storage-erased-adaptation.js.map +1 -0
- package/dist/core/semantic/storage-erased-adaptation.test.d.ts +2 -0
- package/dist/core/semantic/storage-erased-adaptation.test.d.ts.map +1 -0
- package/dist/core/semantic/storage-erased-adaptation.test.js +271 -0
- package/dist/core/semantic/storage-erased-adaptation.test.js.map +1 -0
- package/dist/core/semantic/storage-types.d.ts +8 -0
- package/dist/core/semantic/storage-types.d.ts.map +1 -0
- package/dist/core/semantic/storage-types.js +344 -0
- package/dist/core/semantic/storage-types.js.map +1 -0
- package/dist/core/semantic/storage-types.test.d.ts +2 -0
- package/dist/core/semantic/storage-types.test.d.ts.map +1 -0
- package/dist/core/semantic/storage-types.test.js +438 -0
- package/dist/core/semantic/storage-types.test.js.map +1 -0
- package/dist/core/semantic/structural-resolution.d.ts +11 -0
- package/dist/core/semantic/structural-resolution.d.ts.map +1 -0
- package/dist/core/semantic/structural-resolution.js +11 -0
- package/dist/core/semantic/structural-resolution.js.map +1 -0
- package/dist/core/semantic/structural-shape-matching.d.ts +22 -0
- package/dist/core/semantic/structural-shape-matching.d.ts.map +1 -0
- package/dist/core/semantic/structural-shape-matching.js +255 -0
- package/dist/core/semantic/structural-shape-matching.js.map +1 -0
- package/dist/core/semantic/structural-view-types.d.ts +10 -0
- package/dist/core/semantic/structural-view-types.d.ts.map +1 -0
- package/dist/core/semantic/structural-view-types.js +46 -0
- package/dist/core/semantic/structural-view-types.js.map +1 -0
- package/dist/core/semantic/symbol-types.d.ts +80 -0
- package/dist/core/semantic/symbol-types.d.ts.map +1 -0
- package/dist/core/semantic/symbol-types.js +102 -0
- package/dist/core/semantic/symbol-types.js.map +1 -0
- package/dist/core/semantic/ternary-guards.d.ts +43 -0
- package/dist/core/semantic/ternary-guards.d.ts.map +1 -0
- package/dist/core/semantic/ternary-guards.js +232 -0
- package/dist/core/semantic/ternary-guards.js.map +1 -0
- package/dist/core/semantic/transparent-expressions.d.ts +6 -0
- package/dist/core/semantic/transparent-expressions.d.ts.map +1 -0
- package/dist/core/semantic/transparent-expressions.js +18 -0
- package/dist/core/semantic/transparent-expressions.js.map +1 -0
- package/dist/core/semantic/truthiness-evaluation.d.ts +58 -0
- package/dist/core/semantic/truthiness-evaluation.d.ts.map +1 -0
- package/dist/core/semantic/truthiness-evaluation.js +295 -0
- package/dist/core/semantic/truthiness-evaluation.js.map +1 -0
- package/dist/core/semantic/type-alias-index.d.ts.map +1 -1
- package/dist/core/semantic/type-alias-index.js +1 -11
- package/dist/core/semantic/type-alias-index.js.map +1 -1
- package/dist/core/semantic/type-compatibility.d.ts +1 -1
- package/dist/core/semantic/type-compatibility.d.ts.map +1 -1
- package/dist/core/semantic/type-compatibility.js +75 -15
- package/dist/core/semantic/type-compatibility.js.map +1 -1
- package/dist/core/semantic/type-equivalence.d.ts +4 -0
- package/dist/core/semantic/type-equivalence.d.ts.map +1 -0
- package/dist/core/semantic/type-equivalence.js +255 -0
- package/dist/core/semantic/type-equivalence.js.map +1 -0
- package/dist/core/semantic/type-equivalence.test.d.ts +2 -0
- package/dist/core/semantic/type-equivalence.test.d.ts.map +1 -0
- package/dist/core/semantic/type-equivalence.test.js +380 -0
- package/dist/core/semantic/type-equivalence.test.js.map +1 -0
- package/dist/core/semantic/type-param-substitution.d.ts +19 -0
- package/dist/core/semantic/type-param-substitution.d.ts.map +1 -0
- package/dist/core/semantic/type-param-substitution.js +219 -0
- package/dist/core/semantic/type-param-substitution.js.map +1 -0
- package/dist/core/semantic/type-resolution-cases/array-like-element.test.d.ts +2 -0
- package/dist/core/semantic/type-resolution-cases/array-like-element.test.d.ts.map +1 -0
- package/dist/core/semantic/type-resolution-cases/array-like-element.test.js +82 -0
- package/dist/core/semantic/type-resolution-cases/array-like-element.test.js.map +1 -0
- package/dist/core/semantic/type-resolution-cases/contains-type-parameter.test.d.ts +2 -0
- package/dist/core/semantic/type-resolution-cases/contains-type-parameter.test.d.ts.map +1 -0
- package/dist/core/semantic/type-resolution-cases/contains-type-parameter.test.js +101 -0
- package/dist/core/semantic/type-resolution-cases/contains-type-parameter.test.js.map +1 -0
- package/dist/core/semantic/type-resolution-cases/helpers.d.ts +8 -0
- package/dist/core/semantic/type-resolution-cases/helpers.d.ts.map +1 -0
- package/dist/core/semantic/type-resolution-cases/helpers.js +5 -0
- package/dist/core/semantic/type-resolution-cases/helpers.js.map +1 -0
- package/dist/core/semantic/type-resolution-cases/narrow-typeof.test.d.ts +2 -0
- package/dist/core/semantic/type-resolution-cases/narrow-typeof.test.d.ts.map +1 -0
- package/dist/core/semantic/type-resolution-cases/narrow-typeof.test.js +98 -0
- package/dist/core/semantic/type-resolution-cases/narrow-typeof.test.js.map +1 -0
- package/dist/core/semantic/type-resolution-cases/nullish-and-value-type.test.d.ts +2 -0
- package/dist/core/semantic/type-resolution-cases/nullish-and-value-type.test.d.ts.map +1 -0
- package/dist/core/semantic/type-resolution-cases/nullish-and-value-type.test.js +378 -0
- package/dist/core/semantic/type-resolution-cases/nullish-and-value-type.test.js.map +1 -0
- package/dist/core/semantic/type-resolution-cases/object-literal-member-selection.test.d.ts +2 -0
- package/dist/core/semantic/type-resolution-cases/object-literal-member-selection.test.d.ts.map +1 -0
- package/dist/core/semantic/type-resolution-cases/object-literal-member-selection.test.js +137 -0
- package/dist/core/semantic/type-resolution-cases/object-literal-member-selection.test.js.map +1 -0
- package/dist/core/semantic/type-resolution-cases/property-type.test.d.ts +2 -0
- package/dist/core/semantic/type-resolution-cases/property-type.test.d.ts.map +1 -0
- package/dist/core/semantic/type-resolution-cases/property-type.test.js +298 -0
- package/dist/core/semantic/type-resolution-cases/property-type.test.js.map +1 -0
- package/dist/core/semantic/type-resolution-cases/structural-resolution.test.d.ts +2 -0
- package/dist/core/semantic/type-resolution-cases/structural-resolution.test.d.ts.map +1 -0
- package/dist/core/semantic/type-resolution-cases/structural-resolution.test.js +511 -0
- package/dist/core/semantic/type-resolution-cases/structural-resolution.test.js.map +1 -0
- package/dist/core/semantic/type-resolution-cases/structural-target.test.d.ts +2 -0
- package/dist/core/semantic/type-resolution-cases/structural-target.test.d.ts.map +1 -0
- package/dist/core/semantic/type-resolution-cases/structural-target.test.js +80 -0
- package/dist/core/semantic/type-resolution-cases/structural-target.test.js.map +1 -0
- package/dist/core/semantic/type-resolution-cases/substitute-type-args.test.d.ts +2 -0
- package/dist/core/semantic/type-resolution-cases/substitute-type-args.test.d.ts.map +1 -0
- package/dist/core/semantic/type-resolution-cases/substitute-type-args.test.js +80 -0
- package/dist/core/semantic/type-resolution-cases/substitute-type-args.test.js.map +1 -0
- package/dist/core/semantic/type-resolution-cases/union-member-index.test.d.ts +2 -0
- package/dist/core/semantic/type-resolution-cases/union-member-index.test.d.ts.map +1 -0
- package/dist/core/semantic/type-resolution-cases/union-member-index.test.js +142 -0
- package/dist/core/semantic/type-resolution-cases/union-member-index.test.js.map +1 -0
- package/dist/core/semantic/type-resolution.d.ts +19 -132
- package/dist/core/semantic/type-resolution.d.ts.map +1 -1
- package/dist/core/semantic/type-resolution.js +19 -785
- package/dist/core/semantic/type-resolution.js.map +1 -1
- package/dist/core/semantic/type-resolution.test.d.ts +10 -4
- package/dist/core/semantic/type-resolution.test.d.ts.map +1 -1
- package/dist/core/semantic/type-resolution.test.js +10 -552
- package/dist/core/semantic/type-resolution.test.js.map +1 -1
- package/dist/core/semantic/type-substitution.d.ts +10 -0
- package/dist/core/semantic/type-substitution.d.ts.map +1 -0
- package/dist/core/semantic/type-substitution.js +167 -0
- package/dist/core/semantic/type-substitution.js.map +1 -0
- package/dist/core/semantic/union-member-matching.d.ts +10 -0
- package/dist/core/semantic/union-member-matching.d.ts.map +1 -0
- package/dist/core/semantic/union-member-matching.js +10 -0
- package/dist/core/semantic/union-member-matching.js.map +1 -0
- package/dist/core/semantic/union-predicate-matching.d.ts +40 -0
- package/dist/core/semantic/union-predicate-matching.d.ts.map +1 -0
- package/dist/core/semantic/union-predicate-matching.js +313 -0
- package/dist/core/semantic/union-predicate-matching.js.map +1 -0
- package/dist/core/semantic/union-semantics.d.ts +39 -0
- package/dist/core/semantic/union-semantics.d.ts.map +1 -0
- package/dist/core/semantic/union-semantics.js +48 -0
- package/dist/core/semantic/union-semantics.js.map +1 -0
- package/dist/core/semantic/union-semantics.test.d.ts +2 -0
- package/dist/core/semantic/union-semantics.test.d.ts.map +1 -0
- package/dist/core/semantic/union-semantics.test.js +109 -0
- package/dist/core/semantic/union-semantics.test.js.map +1 -0
- package/dist/core/semantic/union-typeof-matching.d.ts +13 -0
- package/dist/core/semantic/union-typeof-matching.d.ts.map +1 -0
- package/dist/core/semantic/union-typeof-matching.js +124 -0
- package/dist/core/semantic/union-typeof-matching.js.map +1 -0
- package/dist/core/semantic/unsafe.d.ts.map +1 -1
- package/dist/core/semantic/unsafe.js +23 -15
- package/dist/core/semantic/unsafe.js.map +1 -1
- package/dist/core/semantic/value-slot-types.d.ts +3 -0
- package/dist/core/semantic/value-slot-types.d.ts.map +1 -0
- package/dist/core/semantic/value-slot-types.js +8 -0
- package/dist/core/semantic/value-slot-types.js.map +1 -0
- package/dist/core/semantic/variable-type-resolution.d.ts +68 -0
- package/dist/core/semantic/variable-type-resolution.d.ts.map +1 -0
- package/dist/core/semantic/variable-type-resolution.js +250 -0
- package/dist/core/semantic/variable-type-resolution.js.map +1 -0
- package/dist/duplicate-type-suppression.d.ts +18 -0
- package/dist/duplicate-type-suppression.d.ts.map +1 -0
- package/dist/duplicate-type-suppression.js +249 -0
- package/dist/duplicate-type-suppression.js.map +1 -0
- package/dist/duplicate-type-suppression.test.d.ts +2 -0
- package/dist/duplicate-type-suppression.test.d.ts.map +1 -0
- package/dist/duplicate-type-suppression.test.js +44 -0
- package/dist/duplicate-type-suppression.test.js.map +1 -0
- package/dist/emitter-types/context.d.ts +3 -2
- package/dist/emitter-types/context.d.ts.map +1 -1
- package/dist/emitter-types/context.js +8 -2
- package/dist/emitter-types/context.js.map +1 -1
- package/dist/emitter-types/core.d.ts +122 -7
- package/dist/emitter-types/core.d.ts.map +1 -1
- package/dist/emitter.d.ts +4 -0
- package/dist/emitter.d.ts.map +1 -1
- package/dist/emitter.js +31 -305
- package/dist/emitter.js.map +1 -1
- package/dist/expression-emitter.d.ts.map +1 -1
- package/dist/expression-emitter.js +55 -1411
- package/dist/expression-emitter.js.map +1 -1
- package/dist/expressions/access-binding.d.ts +19 -0
- package/dist/expressions/access-binding.d.ts.map +1 -0
- package/dist/expressions/access-binding.js +286 -0
- package/dist/expressions/access-binding.js.map +1 -0
- package/dist/expressions/access-computed.d.ts +22 -0
- package/dist/expressions/access-computed.d.ts.map +1 -0
- package/dist/expressions/access-computed.js +339 -0
- package/dist/expressions/access-computed.js.map +1 -0
- package/dist/expressions/access-length.d.ts +20 -0
- package/dist/expressions/access-length.d.ts.map +1 -0
- package/dist/expressions/access-length.js +419 -0
- package/dist/expressions/access-length.js.map +1 -0
- package/dist/expressions/access-length.test.d.ts +2 -0
- package/dist/expressions/access-length.test.d.ts.map +1 -0
- package/dist/expressions/access-length.test.js +39 -0
- package/dist/expressions/access-length.test.js.map +1 -0
- package/dist/expressions/access-property.d.ts +23 -0
- package/dist/expressions/access-property.d.ts.map +1 -0
- package/dist/expressions/access-property.js +267 -0
- package/dist/expressions/access-property.js.map +1 -0
- package/dist/expressions/access-resolution-receivers.d.ts +27 -0
- package/dist/expressions/access-resolution-receivers.d.ts.map +1 -0
- package/dist/expressions/access-resolution-receivers.js +358 -0
- package/dist/expressions/access-resolution-receivers.js.map +1 -0
- package/dist/expressions/access-resolution-types.d.ts +29 -0
- package/dist/expressions/access-resolution-types.d.ts.map +1 -0
- package/dist/expressions/access-resolution-types.js +192 -0
- package/dist/expressions/access-resolution-types.js.map +1 -0
- package/dist/expressions/access-resolution.d.ts +10 -0
- package/dist/expressions/access-resolution.d.ts.map +1 -0
- package/dist/expressions/access-resolution.js +10 -0
- package/dist/expressions/access-resolution.js.map +1 -0
- package/dist/expressions/access.d.ts +8 -3
- package/dist/expressions/access.d.ts.map +1 -1
- package/dist/expressions/access.js +169 -603
- package/dist/expressions/access.js.map +1 -1
- package/dist/expressions/architecture-invariants.test.d.ts +2 -0
- package/dist/expressions/architecture-invariants.test.d.ts.map +1 -0
- package/dist/expressions/architecture-invariants.test.js +73 -0
- package/dist/expressions/architecture-invariants.test.js.map +1 -0
- package/dist/expressions/array-interop.d.ts +3 -0
- package/dist/expressions/array-interop.d.ts.map +1 -0
- package/dist/expressions/array-interop.js +14 -0
- package/dist/expressions/array-interop.js.map +1 -0
- package/dist/expressions/array-literal.d.ts +13 -0
- package/dist/expressions/array-literal.d.ts.map +1 -0
- package/dist/expressions/array-literal.js +373 -0
- package/dist/expressions/array-literal.js.map +1 -0
- package/dist/expressions/await-normalization.d.ts +6 -0
- package/dist/expressions/await-normalization.d.ts.map +1 -0
- package/dist/expressions/await-normalization.js +358 -0
- package/dist/expressions/await-normalization.js.map +1 -0
- package/dist/expressions/calls/call-analysis.d.ts +8 -6
- package/dist/expressions/calls/call-analysis.d.ts.map +1 -1
- package/dist/expressions/calls/call-analysis.js +120 -31
- package/dist/expressions/calls/call-analysis.js.map +1 -1
- package/dist/expressions/calls/call-analysis.test.js +2 -2
- package/dist/expressions/calls/call-analysis.test.js.map +1 -1
- package/dist/expressions/calls/call-arguments-emit.d.ts +16 -0
- package/dist/expressions/calls/call-arguments-emit.d.ts.map +1 -0
- package/dist/expressions/calls/call-arguments-emit.js +1818 -0
- package/dist/expressions/calls/call-arguments-emit.js.map +1 -0
- package/dist/expressions/calls/call-arguments-helpers.d.ts +22 -0
- package/dist/expressions/calls/call-arguments-helpers.d.ts.map +1 -0
- package/dist/expressions/calls/call-arguments-helpers.js +333 -0
- package/dist/expressions/calls/call-arguments-helpers.js.map +1 -0
- package/dist/expressions/calls/call-arguments.d.ts +10 -0
- package/dist/expressions/calls/call-arguments.d.ts.map +1 -0
- package/dist/expressions/calls/call-arguments.js +10 -0
- package/dist/expressions/calls/call-arguments.js.map +1 -0
- package/dist/expressions/calls/call-array-interop.d.ts +10 -0
- package/dist/expressions/calls/call-array-interop.d.ts.map +1 -0
- package/dist/expressions/calls/call-array-interop.js +10 -0
- package/dist/expressions/calls/call-array-interop.js.map +1 -0
- package/dist/expressions/calls/call-array-mutation.d.ts +20 -0
- package/dist/expressions/calls/call-array-mutation.d.ts.map +1 -0
- package/dist/expressions/calls/call-array-mutation.js +260 -0
- package/dist/expressions/calls/call-array-mutation.js.map +1 -0
- package/dist/expressions/calls/call-array-wrapper.d.ts +14 -0
- package/dist/expressions/calls/call-array-wrapper.d.ts.map +1 -0
- package/dist/expressions/calls/call-array-wrapper.js +118 -0
- package/dist/expressions/calls/call-array-wrapper.js.map +1 -0
- package/dist/expressions/calls/call-binding-resolution.d.ts +8 -0
- package/dist/expressions/calls/call-binding-resolution.d.ts.map +1 -0
- package/dist/expressions/calls/call-binding-resolution.js +12 -0
- package/dist/expressions/calls/call-binding-resolution.js.map +1 -0
- package/dist/expressions/calls/call-dynamic-import.d.ts +11 -0
- package/dist/expressions/calls/call-dynamic-import.d.ts.map +1 -0
- package/dist/expressions/calls/call-dynamic-import.js +148 -0
- package/dist/expressions/calls/call-dynamic-import.js.map +1 -0
- package/dist/expressions/calls/call-emitter.d.ts +9 -3
- package/dist/expressions/calls/call-emitter.d.ts.map +1 -1
- package/dist/expressions/calls/call-emitter.js +231 -1918
- package/dist/expressions/calls/call-emitter.js.map +1 -1
- package/dist/expressions/calls/call-emitter.test.d.ts +2 -0
- package/dist/expressions/calls/call-emitter.test.d.ts.map +1 -0
- package/dist/expressions/calls/call-emitter.test.js +407 -0
- package/dist/expressions/calls/call-emitter.test.js.map +1 -0
- package/dist/expressions/calls/call-extension-methods.d.ts +17 -0
- package/dist/expressions/calls/call-extension-methods.d.ts.map +1 -0
- package/dist/expressions/calls/call-extension-methods.js +191 -0
- package/dist/expressions/calls/call-extension-methods.js.map +1 -0
- package/dist/expressions/calls/call-json.d.ts +15 -0
- package/dist/expressions/calls/call-json.d.ts.map +1 -0
- package/dist/expressions/calls/call-json.js +212 -0
- package/dist/expressions/calls/call-json.js.map +1 -0
- package/dist/expressions/calls/call-promise-chains.d.ts +7 -0
- package/dist/expressions/calls/call-promise-chains.d.ts.map +1 -0
- package/dist/expressions/calls/call-promise-chains.js +411 -0
- package/dist/expressions/calls/call-promise-chains.js.map +1 -0
- package/dist/expressions/calls/call-promise-ir-types.d.ts +11 -0
- package/dist/expressions/calls/call-promise-ir-types.d.ts.map +1 -0
- package/dist/expressions/calls/call-promise-ir-types.js +219 -0
- package/dist/expressions/calls/call-promise-ir-types.js.map +1 -0
- package/dist/expressions/calls/call-promise-normalization.d.ts +11 -0
- package/dist/expressions/calls/call-promise-normalization.d.ts.map +1 -0
- package/dist/expressions/calls/call-promise-normalization.js +179 -0
- package/dist/expressions/calls/call-promise-normalization.js.map +1 -0
- package/dist/expressions/calls/call-promise-static.d.ts +7 -0
- package/dist/expressions/calls/call-promise-static.d.ts.map +1 -0
- package/dist/expressions/calls/call-promise-static.js +188 -0
- package/dist/expressions/calls/call-promise-static.js.map +1 -0
- package/dist/expressions/calls/call-promise-task-types.d.ts +9 -0
- package/dist/expressions/calls/call-promise-task-types.d.ts.map +1 -0
- package/dist/expressions/calls/call-promise-task-types.js +88 -0
- package/dist/expressions/calls/call-promise-task-types.js.map +1 -0
- package/dist/expressions/calls/call-promise.d.ts +11 -0
- package/dist/expressions/calls/call-promise.d.ts.map +1 -0
- package/dist/expressions/calls/call-promise.js +11 -0
- package/dist/expressions/calls/call-promise.js.map +1 -0
- package/dist/expressions/calls/call-runtime-union-guards.d.ts +7 -0
- package/dist/expressions/calls/call-runtime-union-guards.d.ts.map +1 -0
- package/dist/expressions/calls/call-runtime-union-guards.js +131 -0
- package/dist/expressions/calls/call-runtime-union-guards.js.map +1 -0
- package/dist/expressions/calls/call-symbol.d.ts +7 -0
- package/dist/expressions/calls/call-symbol.d.ts.map +1 -0
- package/dist/expressions/calls/call-symbol.js +26 -0
- package/dist/expressions/calls/call-symbol.js.map +1 -0
- package/dist/expressions/calls/new-emitter-collections.d.ts +31 -0
- package/dist/expressions/calls/new-emitter-collections.d.ts.map +1 -0
- package/dist/expressions/calls/new-emitter-collections.js +310 -0
- package/dist/expressions/calls/new-emitter-collections.js.map +1 -0
- package/dist/expressions/calls/new-emitter-promise.d.ts +10 -0
- package/dist/expressions/calls/new-emitter-promise.d.ts.map +1 -0
- package/dist/expressions/calls/new-emitter-promise.js +437 -0
- package/dist/expressions/calls/new-emitter-promise.js.map +1 -0
- package/dist/expressions/calls/new-emitter.d.ts.map +1 -1
- package/dist/expressions/calls/new-emitter.js +28 -557
- package/dist/expressions/calls/new-emitter.js.map +1 -1
- package/dist/expressions/calls/runtime-expected-type-preference.d.ts +4 -0
- package/dist/expressions/calls/runtime-expected-type-preference.d.ts.map +1 -0
- package/dist/expressions/calls/runtime-expected-type-preference.js +61 -0
- package/dist/expressions/calls/runtime-expected-type-preference.js.map +1 -0
- package/dist/expressions/collections.d.ts +4 -21
- package/dist/expressions/collections.d.ts.map +1 -1
- package/dist/expressions/collections.js +3 -959
- package/dist/expressions/collections.js.map +1 -1
- package/dist/expressions/dictionary-literal.d.ts +20 -0
- package/dist/expressions/dictionary-literal.d.ts.map +1 -0
- package/dist/expressions/dictionary-literal.js +214 -0
- package/dist/expressions/dictionary-literal.js.map +1 -0
- package/dist/expressions/dictionary-safe-access.d.ts +4 -0
- package/dist/expressions/dictionary-safe-access.d.ts.map +1 -0
- package/dist/expressions/dictionary-safe-access.js +86 -0
- package/dist/expressions/dictionary-safe-access.js.map +1 -0
- package/dist/expressions/direct-storage-types.d.ts +10 -0
- package/dist/expressions/direct-storage-types.d.ts.map +1 -0
- package/dist/expressions/direct-storage-types.js +441 -0
- package/dist/expressions/direct-storage-types.js.map +1 -0
- package/dist/expressions/exact-comparison.d.ts +17 -0
- package/dist/expressions/exact-comparison.d.ts.map +1 -0
- package/dist/expressions/exact-comparison.js +240 -0
- package/dist/expressions/exact-comparison.js.map +1 -0
- package/dist/expressions/exact-global-bindings.d.ts +6 -0
- package/dist/expressions/exact-global-bindings.d.ts.map +1 -0
- package/dist/expressions/exact-global-bindings.js +15 -0
- package/dist/expressions/exact-global-bindings.js.map +1 -0
- package/dist/expressions/expected-type-adaptation.d.ts +55 -0
- package/dist/expressions/expected-type-adaptation.d.ts.map +1 -0
- package/dist/expressions/expected-type-adaptation.js +918 -0
- package/dist/expressions/expected-type-adaptation.js.map +1 -0
- package/dist/expressions/expected-type-adaptation.test.d.ts +2 -0
- package/dist/expressions/expected-type-adaptation.test.d.ts.map +1 -0
- package/dist/expressions/expected-type-adaptation.test.js +1363 -0
- package/dist/expressions/expected-type-adaptation.test.js.map +1 -0
- package/dist/expressions/functions.d.ts +6 -15
- package/dist/expressions/functions.d.ts.map +1 -1
- package/dist/expressions/functions.js +6 -213
- package/dist/expressions/functions.js.map +1 -1
- package/dist/expressions/identifier-storage.d.ts +43 -0
- package/dist/expressions/identifier-storage.d.ts.map +1 -0
- package/dist/expressions/identifier-storage.js +478 -0
- package/dist/expressions/identifier-storage.js.map +1 -0
- package/dist/expressions/identifiers.d.ts.map +1 -1
- package/dist/expressions/identifiers.js +126 -11
- package/dist/expressions/identifiers.js.map +1 -1
- package/dist/expressions/index-cases/alias-carrier-widening.test.d.ts +2 -0
- package/dist/expressions/index-cases/alias-carrier-widening.test.d.ts.map +1 -0
- package/dist/expressions/index-cases/alias-carrier-widening.test.js +347 -0
- package/dist/expressions/index-cases/alias-carrier-widening.test.js.map +1 -0
- package/dist/expressions/index-cases/array-wrapper-recursion-b.test.d.ts +2 -0
- package/dist/expressions/index-cases/array-wrapper-recursion-b.test.d.ts.map +1 -0
- package/dist/expressions/index-cases/array-wrapper-recursion-b.test.js +356 -0
- package/dist/expressions/index-cases/array-wrapper-recursion-b.test.js.map +1 -0
- package/dist/expressions/index-cases/array-wrapper-recursion-c.test.d.ts +2 -0
- package/dist/expressions/index-cases/array-wrapper-recursion-c.test.d.ts.map +1 -0
- package/dist/expressions/index-cases/array-wrapper-recursion-c.test.js +233 -0
- package/dist/expressions/index-cases/array-wrapper-recursion-c.test.js.map +1 -0
- package/dist/expressions/index-cases/basic-literals-and-calls.test.d.ts +2 -0
- package/dist/expressions/index-cases/basic-literals-and-calls.test.d.ts.map +1 -0
- package/dist/expressions/index-cases/basic-literals-and-calls.test.js +550 -0
- package/dist/expressions/index-cases/basic-literals-and-calls.test.js.map +1 -0
- package/dist/expressions/index-cases/defaults-and-char-context.test.d.ts +2 -0
- package/dist/expressions/index-cases/defaults-and-char-context.test.d.ts.map +1 -0
- package/dist/expressions/index-cases/defaults-and-char-context.test.js +951 -0
- package/dist/expressions/index-cases/defaults-and-char-context.test.js.map +1 -0
- package/dist/expressions/index-cases/dictionary-and-object-initializers-a.test.d.ts +2 -0
- package/dist/expressions/index-cases/dictionary-and-object-initializers-a.test.d.ts.map +1 -0
- package/dist/expressions/index-cases/dictionary-and-object-initializers-a.test.js +533 -0
- package/dist/expressions/index-cases/dictionary-and-object-initializers-a.test.js.map +1 -0
- package/dist/expressions/index-cases/dictionary-and-object-initializers-b.test.d.ts +2 -0
- package/dist/expressions/index-cases/dictionary-and-object-initializers-b.test.d.ts.map +1 -0
- package/dist/expressions/index-cases/dictionary-and-object-initializers-b.test.js +336 -0
- package/dist/expressions/index-cases/dictionary-and-object-initializers-b.test.js.map +1 -0
- package/dist/expressions/index-cases/fluent-and-ef-operators.test.d.ts +2 -0
- package/dist/expressions/index-cases/fluent-and-ef-operators.test.d.ts.map +1 -0
- package/dist/expressions/index-cases/fluent-and-ef-operators.test.js +352 -0
- package/dist/expressions/index-cases/fluent-and-ef-operators.test.js.map +1 -0
- package/dist/expressions/index-cases/helpers.d.ts +13 -0
- package/dist/expressions/index-cases/helpers.d.ts.map +1 -0
- package/dist/expressions/index-cases/helpers.js +27 -0
- package/dist/expressions/index-cases/helpers.js.map +1 -0
- package/dist/expressions/index-cases/member-access-and-array-wrappers-a.test.d.ts +2 -0
- package/dist/expressions/index-cases/member-access-and-array-wrappers-a.test.d.ts.map +1 -0
- package/dist/expressions/index-cases/member-access-and-array-wrappers-a.test.js +429 -0
- package/dist/expressions/index-cases/member-access-and-array-wrappers-a.test.js.map +1 -0
- package/dist/expressions/index-cases/nullable-and-comparisons.test.d.ts +2 -0
- package/dist/expressions/index-cases/nullable-and-comparisons.test.d.ts.map +1 -0
- package/dist/expressions/index-cases/nullable-and-comparisons.test.js +423 -0
- package/dist/expressions/index-cases/nullable-and-comparisons.test.js.map +1 -0
- package/dist/expressions/index-cases/runtime-subset-and-assertions.test.d.ts +2 -0
- package/dist/expressions/index-cases/runtime-subset-and-assertions.test.d.ts.map +1 -0
- package/dist/expressions/index-cases/runtime-subset-and-assertions.test.js +482 -0
- package/dist/expressions/index-cases/runtime-subset-and-assertions.test.js.map +1 -0
- package/dist/expressions/index-cases/runtime-union-reification-a.test.d.ts +2 -0
- package/dist/expressions/index-cases/runtime-union-reification-a.test.d.ts.map +1 -0
- package/dist/expressions/index-cases/runtime-union-reification-a.test.js +454 -0
- package/dist/expressions/index-cases/runtime-union-reification-a.test.js.map +1 -0
- package/dist/expressions/index-cases/runtime-union-reification-b.test.d.ts +2 -0
- package/dist/expressions/index-cases/runtime-union-reification-b.test.d.ts.map +1 -0
- package/dist/expressions/index-cases/runtime-union-reification-b.test.js +852 -0
- package/dist/expressions/index-cases/runtime-union-reification-b.test.js.map +1 -0
- package/dist/expressions/index-cases/spreads-and-member-bindings.test.d.ts +2 -0
- package/dist/expressions/index-cases/spreads-and-member-bindings.test.d.ts.map +1 -0
- package/dist/expressions/index-cases/spreads-and-member-bindings.test.js +616 -0
- package/dist/expressions/index-cases/spreads-and-member-bindings.test.js.map +1 -0
- package/dist/expressions/index-cases/string-and-array-fallbacks-a.test.d.ts +2 -0
- package/dist/expressions/index-cases/string-and-array-fallbacks-a.test.d.ts.map +1 -0
- package/dist/expressions/index-cases/string-and-array-fallbacks-a.test.js +304 -0
- package/dist/expressions/index-cases/string-and-array-fallbacks-a.test.js.map +1 -0
- package/dist/expressions/index-cases/string-and-array-fallbacks-b.test.d.ts +2 -0
- package/dist/expressions/index-cases/string-and-array-fallbacks-b.test.d.ts.map +1 -0
- package/dist/expressions/index-cases/string-and-array-fallbacks-b.test.js +369 -0
- package/dist/expressions/index-cases/string-and-array-fallbacks-b.test.js.map +1 -0
- package/dist/expressions/index-cases/tuple-rest-and-unions.test.d.ts +2 -0
- package/dist/expressions/index-cases/tuple-rest-and-unions.test.d.ts.map +1 -0
- package/dist/expressions/index-cases/tuple-rest-and-unions.test.js +392 -0
- package/dist/expressions/index-cases/tuple-rest-and-unions.test.js.map +1 -0
- package/dist/expressions/index.test.d.ts +17 -5
- package/dist/expressions/index.test.d.ts.map +1 -1
- package/dist/expressions/index.test.js +17 -2835
- package/dist/expressions/index.test.js.map +1 -1
- package/dist/expressions/invoked-lambda.d.ts +12 -0
- package/dist/expressions/invoked-lambda.d.ts.map +1 -0
- package/dist/expressions/invoked-lambda.js +69 -0
- package/dist/expressions/invoked-lambda.js.map +1 -0
- package/dist/expressions/lambda-body.d.ts +23 -0
- package/dist/expressions/lambda-body.d.ts.map +1 -0
- package/dist/expressions/lambda-body.js +421 -0
- package/dist/expressions/lambda-body.js.map +1 -0
- package/dist/expressions/lambda-parameters.d.ts +32 -0
- package/dist/expressions/lambda-parameters.d.ts.map +1 -0
- package/dist/expressions/lambda-parameters.js +279 -0
- package/dist/expressions/lambda-parameters.js.map +1 -0
- package/dist/expressions/literals.d.ts.map +1 -1
- package/dist/expressions/literals.js +18 -3
- package/dist/expressions/literals.js.map +1 -1
- package/dist/expressions/literals.test.js +48 -0
- package/dist/expressions/literals.test.js.map +1 -1
- package/dist/expressions/object-helpers.d.ts +22 -0
- package/dist/expressions/object-helpers.d.ts.map +1 -0
- package/dist/expressions/object-helpers.js +98 -0
- package/dist/expressions/object-helpers.js.map +1 -0
- package/dist/expressions/object-literal-spreads.d.ts +20 -0
- package/dist/expressions/object-literal-spreads.d.ts.map +1 -0
- package/dist/expressions/object-literal-spreads.js +188 -0
- package/dist/expressions/object-literal-spreads.js.map +1 -0
- package/dist/expressions/object-literal.d.ts +18 -0
- package/dist/expressions/object-literal.d.ts.map +1 -0
- package/dist/expressions/object-literal.js +178 -0
- package/dist/expressions/object-literal.js.map +1 -0
- package/dist/expressions/operators/assignment-emitter.d.ts.map +1 -1
- package/dist/expressions/operators/assignment-emitter.js +78 -27
- package/dist/expressions/operators/assignment-emitter.js.map +1 -1
- package/dist/expressions/operators/binary-dispatch.d.ts +37 -0
- package/dist/expressions/operators/binary-dispatch.d.ts.map +1 -0
- package/dist/expressions/operators/binary-dispatch.js +449 -0
- package/dist/expressions/operators/binary-dispatch.js.map +1 -0
- package/dist/expressions/operators/binary-emitter.d.ts +6 -29
- package/dist/expressions/operators/binary-emitter.d.ts.map +1 -1
- package/dist/expressions/operators/binary-emitter.js +6 -419
- package/dist/expressions/operators/binary-emitter.js.map +1 -1
- package/dist/expressions/operators/binary-helpers.d.ts +17 -0
- package/dist/expressions/operators/binary-helpers.d.ts.map +1 -0
- package/dist/expressions/operators/binary-helpers.js +119 -0
- package/dist/expressions/operators/binary-helpers.js.map +1 -0
- package/dist/expressions/operators/binary-runtime-union-comparison.d.ts +7 -0
- package/dist/expressions/operators/binary-runtime-union-comparison.d.ts.map +1 -0
- package/dist/expressions/operators/binary-runtime-union-comparison.js +150 -0
- package/dist/expressions/operators/binary-runtime-union-comparison.js.map +1 -0
- package/dist/expressions/operators/binary-special-ops.d.ts +29 -0
- package/dist/expressions/operators/binary-special-ops.d.ts.map +1 -0
- package/dist/expressions/operators/binary-special-ops.js +468 -0
- package/dist/expressions/operators/binary-special-ops.js.map +1 -0
- package/dist/expressions/operators/conditional-emitter.d.ts.map +1 -1
- package/dist/expressions/operators/conditional-emitter.js +221 -216
- package/dist/expressions/operators/conditional-emitter.js.map +1 -1
- package/dist/expressions/operators/helpers.d.ts +10 -0
- package/dist/expressions/operators/helpers.d.ts.map +1 -1
- package/dist/expressions/operators/helpers.js +30 -0
- package/dist/expressions/operators/helpers.js.map +1 -1
- package/dist/expressions/operators/logical-emitter.d.ts +2 -2
- package/dist/expressions/operators/logical-emitter.d.ts.map +1 -1
- package/dist/expressions/operators/logical-emitter.js +293 -10
- package/dist/expressions/operators/logical-emitter.js.map +1 -1
- package/dist/expressions/operators/unary-emitter.d.ts.map +1 -1
- package/dist/expressions/operators/unary-emitter.js +6 -21
- package/dist/expressions/operators/unary-emitter.js.map +1 -1
- package/dist/expressions/operators/write-targets.d.ts +5 -0
- package/dist/expressions/operators/write-targets.d.ts.map +1 -0
- package/dist/expressions/operators/write-targets.js +65 -0
- package/dist/expressions/operators/write-targets.js.map +1 -0
- package/dist/expressions/other.d.ts.map +1 -1
- package/dist/expressions/other.js +17 -50
- package/dist/expressions/other.js.map +1 -1
- package/dist/expressions/post-emission-adaptation.d.ts +19 -0
- package/dist/expressions/post-emission-adaptation.d.ts.map +1 -0
- package/dist/expressions/post-emission-adaptation.js +939 -0
- package/dist/expressions/post-emission-adaptation.js.map +1 -0
- package/dist/expressions/runtime-union-adaptation-projection.d.ts +12 -0
- package/dist/expressions/runtime-union-adaptation-projection.d.ts.map +1 -0
- package/dist/expressions/runtime-union-adaptation-projection.js +182 -0
- package/dist/expressions/runtime-union-adaptation-projection.js.map +1 -0
- package/dist/expressions/runtime-union-adaptation-upcast.d.ts +11 -0
- package/dist/expressions/runtime-union-adaptation-upcast.d.ts.map +1 -0
- package/dist/expressions/runtime-union-adaptation-upcast.js +722 -0
- package/dist/expressions/runtime-union-adaptation-upcast.js.map +1 -0
- package/dist/expressions/runtime-union-adaptation.d.ts +10 -0
- package/dist/expressions/runtime-union-adaptation.d.ts.map +1 -0
- package/dist/expressions/runtime-union-adaptation.js +10 -0
- package/dist/expressions/runtime-union-adaptation.js.map +1 -0
- package/dist/expressions/structural-adaptation-types.d.ts +12 -0
- package/dist/expressions/structural-adaptation-types.d.ts.map +1 -0
- package/dist/expressions/structural-adaptation-types.js +3 -0
- package/dist/expressions/structural-adaptation-types.js.map +1 -0
- package/dist/expressions/structural-adaptation.d.ts +16 -0
- package/dist/expressions/structural-adaptation.d.ts.map +1 -0
- package/dist/expressions/structural-adaptation.js +14 -0
- package/dist/expressions/structural-adaptation.js.map +1 -0
- package/dist/expressions/structural-anonymous-targets.d.ts +4 -0
- package/dist/expressions/structural-anonymous-targets.d.ts.map +1 -0
- package/dist/expressions/structural-anonymous-targets.js +156 -0
- package/dist/expressions/structural-anonymous-targets.js.map +1 -0
- package/dist/expressions/structural-collection-adaptation.d.ts +7 -0
- package/dist/expressions/structural-collection-adaptation.d.ts.map +1 -0
- package/dist/expressions/structural-collection-adaptation.js +682 -0
- package/dist/expressions/structural-collection-adaptation.js.map +1 -0
- package/dist/expressions/structural-object-adaptation.d.ts +6 -0
- package/dist/expressions/structural-object-adaptation.d.ts.map +1 -0
- package/dist/expressions/structural-object-adaptation.js +213 -0
- package/dist/expressions/structural-object-adaptation.js.map +1 -0
- package/dist/expressions/structural-property-model.d.ts +6 -0
- package/dist/expressions/structural-property-model.d.ts.map +1 -0
- package/dist/expressions/structural-property-model.js +304 -0
- package/dist/expressions/structural-property-model.js.map +1 -0
- package/dist/expressions/structural-type-shapes.d.ts +19 -0
- package/dist/expressions/structural-type-shapes.d.ts.map +1 -0
- package/dist/expressions/structural-type-shapes.js +318 -0
- package/dist/expressions/structural-type-shapes.js.map +1 -0
- package/dist/expressions/structural-type-shapes.test.d.ts +2 -0
- package/dist/expressions/structural-type-shapes.test.d.ts.map +1 -0
- package/dist/expressions/structural-type-shapes.test.js +60 -0
- package/dist/expressions/structural-type-shapes.test.js.map +1 -0
- package/dist/expressions/type-assertion-emitters.d.ts +50 -0
- package/dist/expressions/type-assertion-emitters.d.ts.map +1 -0
- package/dist/expressions/type-assertion-emitters.js +675 -0
- package/dist/expressions/type-assertion-emitters.js.map +1 -0
- package/dist/fixture-regression-mirrors.test.d.ts +2 -0
- package/dist/fixture-regression-mirrors.test.d.ts.map +1 -0
- package/dist/fixture-regression-mirrors.test.js +580 -0
- package/dist/fixture-regression-mirrors.test.js.map +1 -0
- package/dist/generated-files.d.ts +19 -0
- package/dist/generated-files.d.ts.map +1 -0
- package/dist/generated-files.js +519 -0
- package/dist/generated-files.js.map +1 -0
- package/dist/generated-files.test.d.ts +2 -0
- package/dist/generated-files.test.d.ts.map +1 -0
- package/dist/generated-files.test.js +103 -0
- package/dist/generated-files.test.js.map +1 -0
- package/dist/generator-cases/bidirectional-core.test.d.ts +6 -0
- package/dist/generator-cases/bidirectional-core.test.d.ts.map +1 -0
- package/dist/generator-cases/bidirectional-core.test.js +272 -0
- package/dist/generator-cases/bidirectional-core.test.js.map +1 -0
- package/dist/generator-cases/bidirectional-features.test.d.ts +6 -0
- package/dist/generator-cases/bidirectional-features.test.d.ts.map +1 -0
- package/dist/generator-cases/bidirectional-features.test.js +360 -0
- package/dist/generator-cases/bidirectional-features.test.js.map +1 -0
- package/dist/generator-cases/simple-generators.test.d.ts +6 -0
- package/dist/generator-cases/simple-generators.test.d.ts.map +1 -0
- package/dist/generator-cases/simple-generators.test.js +227 -0
- package/dist/generator-cases/simple-generators.test.js.map +1 -0
- package/dist/generator-exchange.d.ts +3 -2
- package/dist/generator-exchange.d.ts.map +1 -1
- package/dist/generator-exchange.js +46 -15
- package/dist/generator-exchange.js.map +1 -1
- package/dist/generator-wrapper-builders.d.ts +10 -0
- package/dist/generator-wrapper-builders.d.ts.map +1 -0
- package/dist/generator-wrapper-builders.js +288 -0
- package/dist/generator-wrapper-builders.js.map +1 -0
- package/dist/generator-wrapper.d.ts +16 -5
- package/dist/generator-wrapper.d.ts.map +1 -1
- package/dist/generator-wrapper.js +47 -288
- package/dist/generator-wrapper.js.map +1 -1
- package/dist/generator.test.d.ts +3 -5
- package/dist/generator.test.d.ts.map +1 -1
- package/dist/generator.test.js +3 -766
- package/dist/generator.test.js.map +1 -1
- package/dist/golden-tests/config-parser.d.ts.map +1 -1
- package/dist/golden-tests/config-parser.js +7 -0
- package/dist/golden-tests/config-parser.js.map +1 -1
- package/dist/golden-tests/discovery.js +1 -0
- package/dist/golden-tests/discovery.js.map +1 -1
- package/dist/golden-tests/runner.d.ts.map +1 -1
- package/dist/golden-tests/runner.js +12 -40
- package/dist/golden-tests/runner.js.map +1 -1
- package/dist/golden-tests/types.d.ts +2 -0
- package/dist/golden-tests/types.d.ts.map +1 -1
- package/dist/hierarchical-bindings.test.js +6 -9
- package/dist/hierarchical-bindings.test.js.map +1 -1
- package/dist/integration-cases/arrow-and-generics-a.test.d.ts +2 -0
- package/dist/integration-cases/arrow-and-generics-a.test.d.ts.map +1 -0
- package/dist/integration-cases/arrow-and-generics-a.test.js +695 -0
- package/dist/integration-cases/arrow-and-generics-a.test.js.map +1 -0
- package/dist/integration-cases/arrow-and-generics-b.test.d.ts +2 -0
- package/dist/integration-cases/arrow-and-generics-b.test.d.ts.map +1 -0
- package/dist/integration-cases/arrow-and-generics-b.test.js +218 -0
- package/dist/integration-cases/arrow-and-generics-b.test.js.map +1 -0
- package/dist/integration-cases/await-and-intrinsics.test.d.ts +2 -0
- package/dist/integration-cases/await-and-intrinsics.test.d.ts.map +1 -0
- package/dist/integration-cases/await-and-intrinsics.test.js +237 -0
- package/dist/integration-cases/await-and-intrinsics.test.js.map +1 -0
- package/dist/integration-cases/clr-iterable-overloads.test.d.ts +2 -0
- package/dist/integration-cases/clr-iterable-overloads.test.d.ts.map +1 -0
- package/dist/integration-cases/clr-iterable-overloads.test.js +446 -0
- package/dist/integration-cases/clr-iterable-overloads.test.js.map +1 -0
- package/dist/integration-cases/full-module-and-promises.test.d.ts +2 -0
- package/dist/integration-cases/full-module-and-promises.test.d.ts.map +1 -0
- package/dist/integration-cases/full-module-and-promises.test.js +472 -0
- package/dist/integration-cases/full-module-and-promises.test.js.map +1 -0
- package/dist/integration-cases/helpers.d.ts +7 -0
- package/dist/integration-cases/helpers.d.ts.map +1 -0
- package/dist/integration-cases/helpers.js +348 -0
- package/dist/integration-cases/helpers.js.map +1 -0
- package/dist/integration-cases/object-literals-and-channels.test.d.ts +2 -0
- package/dist/integration-cases/object-literals-and-channels.test.d.ts.map +1 -0
- package/dist/integration-cases/object-literals-and-channels.test.js +72 -0
- package/dist/integration-cases/object-literals-and-channels.test.js.map +1 -0
- package/dist/integration-cases/regression-coverage-a.test.d.ts +2 -0
- package/dist/integration-cases/regression-coverage-a.test.d.ts.map +1 -0
- package/dist/integration-cases/regression-coverage-a.test.js +533 -0
- package/dist/integration-cases/regression-coverage-a.test.js.map +1 -0
- package/dist/integration-cases/regression-coverage-b.test.d.ts +2 -0
- package/dist/integration-cases/regression-coverage-b.test.d.ts.map +1 -0
- package/dist/integration-cases/regression-coverage-b.test.js +806 -0
- package/dist/integration-cases/regression-coverage-b.test.js.map +1 -0
- package/dist/integration-cases/regression-coverage-c.test.d.ts +2 -0
- package/dist/integration-cases/regression-coverage-c.test.d.ts.map +1 -0
- package/dist/integration-cases/regression-coverage-c.test.js +4139 -0
- package/dist/integration-cases/regression-coverage-c.test.js.map +1 -0
- package/dist/integration.test.d.ts +9 -5
- package/dist/integration.test.d.ts.map +1 -1
- package/dist/integration.test.js +9 -1223
- package/dist/integration.test.js.map +1 -1
- package/dist/invariants/numeric-proof-contract-cases/emitter-and-annotations.test.d.ts +5 -0
- package/dist/invariants/numeric-proof-contract-cases/emitter-and-annotations.test.d.ts.map +1 -0
- package/dist/invariants/numeric-proof-contract-cases/emitter-and-annotations.test.js +93 -0
- package/dist/invariants/numeric-proof-contract-cases/emitter-and-annotations.test.js.map +1 -0
- package/dist/invariants/numeric-proof-contract-cases/helpers.d.ts +14 -0
- package/dist/invariants/numeric-proof-contract-cases/helpers.d.ts.map +1 -0
- package/dist/invariants/numeric-proof-contract-cases/helpers.js +158 -0
- package/dist/invariants/numeric-proof-contract-cases/helpers.js.map +1 -0
- package/dist/invariants/numeric-proof-contract-cases/proof-and-diagnostics.test.d.ts +5 -0
- package/dist/invariants/numeric-proof-contract-cases/proof-and-diagnostics.test.d.ts.map +1 -0
- package/dist/invariants/numeric-proof-contract-cases/proof-and-diagnostics.test.js +242 -0
- package/dist/invariants/numeric-proof-contract-cases/proof-and-diagnostics.test.js.map +1 -0
- package/dist/invariants/numeric-proof-contract.test.d.ts +2 -18
- package/dist/invariants/numeric-proof-contract.test.d.ts.map +1 -1
- package/dist/invariants/numeric-proof-contract.test.js +2 -510
- package/dist/invariants/numeric-proof-contract.test.js.map +1 -1
- package/dist/json-aot-generic.test.js +320 -5
- package/dist/json-aot-generic.test.js.map +1 -1
- package/dist/naming-policy.d.ts.map +1 -1
- package/dist/naming-policy.js +19 -0
- package/dist/naming-policy.js.map +1 -1
- package/dist/patterns/local-lowering.d.ts +27 -0
- package/dist/patterns/local-lowering.d.ts.map +1 -0
- package/dist/patterns/local-lowering.js +296 -0
- package/dist/patterns/local-lowering.js.map +1 -0
- package/dist/patterns/static-assignment-lowering.d.ts +11 -0
- package/dist/patterns/static-assignment-lowering.d.ts.map +1 -0
- package/dist/patterns/static-assignment-lowering.js +11 -0
- package/dist/patterns/static-assignment-lowering.js.map +1 -0
- package/dist/patterns/static-lowering-assignments.d.ts +16 -0
- package/dist/patterns/static-lowering-assignments.d.ts.map +1 -0
- package/dist/patterns/static-lowering-assignments.js +269 -0
- package/dist/patterns/static-lowering-assignments.js.map +1 -0
- package/dist/patterns/static-lowering-members.d.ts +15 -0
- package/dist/patterns/static-lowering-members.d.ts.map +1 -0
- package/dist/patterns/static-lowering-members.js +231 -0
- package/dist/patterns/static-lowering-members.js.map +1 -0
- package/dist/patterns-cases/array-and-object.test.d.ts +2 -0
- package/dist/patterns-cases/array-and-object.test.d.ts.map +1 -0
- package/dist/patterns-cases/array-and-object.test.js +370 -0
- package/dist/patterns-cases/array-and-object.test.js.map +1 -0
- package/dist/patterns-cases/assignments-and-complex.test.d.ts +2 -0
- package/dist/patterns-cases/assignments-and-complex.test.d.ts.map +1 -0
- package/dist/patterns-cases/assignments-and-complex.test.js +361 -0
- package/dist/patterns-cases/assignments-and-complex.test.js.map +1 -0
- package/dist/patterns-cases/edge-cases.test.d.ts +2 -0
- package/dist/patterns-cases/edge-cases.test.d.ts.map +1 -0
- package/dist/patterns-cases/edge-cases.test.js +133 -0
- package/dist/patterns-cases/edge-cases.test.js.map +1 -0
- package/dist/patterns-cases/helpers.d.ts +6 -0
- package/dist/patterns-cases/helpers.d.ts.map +1 -0
- package/dist/patterns-cases/helpers.js +33 -0
- package/dist/patterns-cases/helpers.js.map +1 -0
- package/dist/patterns-cases/loops-and-parameters.test.d.ts +2 -0
- package/dist/patterns-cases/loops-and-parameters.test.d.ts.map +1 -0
- package/dist/patterns-cases/loops-and-parameters.test.js +275 -0
- package/dist/patterns-cases/loops-and-parameters.test.js.map +1 -0
- package/dist/patterns-cases/methods-and-semantic-infra.test.d.ts +2 -0
- package/dist/patterns-cases/methods-and-semantic-infra.test.d.ts.map +1 -0
- package/dist/patterns-cases/methods-and-semantic-infra.test.js +438 -0
- package/dist/patterns-cases/methods-and-semantic-infra.test.js.map +1 -0
- package/dist/patterns.d.ts +5 -20
- package/dist/patterns.d.ts.map +1 -1
- package/dist/patterns.js +3 -809
- package/dist/patterns.js.map +1 -1
- package/dist/patterns.test.d.ts +5 -14
- package/dist/patterns.test.d.ts.map +1 -1
- package/dist/patterns.test.js +5 -1341
- package/dist/patterns.test.js.map +1 -1
- package/dist/runtime-union-cases/helpers.d.ts +7 -0
- package/dist/runtime-union-cases/helpers.d.ts.map +1 -0
- package/dist/runtime-union-cases/helpers.js +17 -0
- package/dist/runtime-union-cases/helpers.js.map +1 -0
- package/dist/specialization/generic-functions-cases/basics-and-structural.test.d.ts +6 -0
- package/dist/specialization/generic-functions-cases/basics-and-structural.test.d.ts.map +1 -0
- package/dist/specialization/generic-functions-cases/basics-and-structural.test.js +357 -0
- package/dist/specialization/generic-functions-cases/basics-and-structural.test.js.map +1 -0
- package/dist/specialization/generic-functions-cases/class-and-interface-constraints.test.d.ts +6 -0
- package/dist/specialization/generic-functions-cases/class-and-interface-constraints.test.d.ts.map +1 -0
- package/dist/specialization/generic-functions-cases/class-and-interface-constraints.test.js +304 -0
- package/dist/specialization/generic-functions-cases/class-and-interface-constraints.test.js.map +1 -0
- package/dist/specialization/generic-functions.test.d.ts +2 -5
- package/dist/specialization/generic-functions.test.d.ts.map +1 -1
- package/dist/specialization/generic-functions.test.js +2 -650
- package/dist/specialization/generic-functions.test.js.map +1 -1
- package/dist/specialization/helpers.d.ts.map +1 -1
- package/dist/specialization/helpers.js +2 -16
- package/dist/specialization/helpers.js.map +1 -1
- package/dist/specialization/interfaces.test.js +58 -0
- package/dist/specialization/interfaces.test.js.map +1 -1
- package/dist/specialization/naming.d.ts.map +1 -1
- package/dist/specialization/naming.js +9 -2
- package/dist/specialization/naming.js.map +1 -1
- package/dist/statements/block-emitters/block-and-return.d.ts +10 -0
- package/dist/statements/block-emitters/block-and-return.d.ts.map +1 -0
- package/dist/statements/block-emitters/block-and-return.js +132 -0
- package/dist/statements/block-emitters/block-and-return.js.map +1 -0
- package/dist/statements/block-emitters/expression-statements.d.ts +7 -0
- package/dist/statements/block-emitters/expression-statements.d.ts.map +1 -0
- package/dist/statements/block-emitters/expression-statements.js +72 -0
- package/dist/statements/block-emitters/expression-statements.js.map +1 -0
- package/dist/statements/block-emitters/yield-statements.d.ts +13 -0
- package/dist/statements/block-emitters/yield-statements.d.ts.map +1 -0
- package/dist/statements/block-emitters/yield-statements.js +217 -0
- package/dist/statements/block-emitters/yield-statements.js.map +1 -0
- package/dist/statements/blocks.d.ts +3 -86
- package/dist/statements/blocks.d.ts.map +1 -1
- package/dist/statements/blocks.js +3 -443
- package/dist/statements/blocks.js.map +1 -1
- package/dist/statements/classes/members/constructors.d.ts.map +1 -1
- package/dist/statements/classes/members/constructors.js +105 -13
- package/dist/statements/classes/members/constructors.js.map +1 -1
- package/dist/statements/classes/members/methods.d.ts +1 -1
- package/dist/statements/classes/members/methods.d.ts.map +1 -1
- package/dist/statements/classes/members/methods.js +329 -76
- package/dist/statements/classes/members/methods.js.map +1 -1
- package/dist/statements/classes/members/orchestrator.d.ts +3 -3
- package/dist/statements/classes/members/orchestrator.d.ts.map +1 -1
- package/dist/statements/classes/members/orchestrator.js +10 -4
- package/dist/statements/classes/members/orchestrator.js.map +1 -1
- package/dist/statements/classes/members/properties.d.ts.map +1 -1
- package/dist/statements/classes/members/properties.js +29 -5
- package/dist/statements/classes/members/properties.js.map +1 -1
- package/dist/statements/classes/members/shadowing.test.js +3 -2
- package/dist/statements/classes/members/shadowing.test.js.map +1 -1
- package/dist/statements/classes/parameters.d.ts +9 -1
- package/dist/statements/classes/parameters.d.ts.map +1 -1
- package/dist/statements/classes/parameters.js +86 -6
- package/dist/statements/classes/parameters.js.map +1 -1
- package/dist/statements/classes/properties.d.ts.map +1 -1
- package/dist/statements/classes/properties.js +2 -1
- package/dist/statements/classes/properties.js.map +1 -1
- package/dist/statements/control/conditionals/branch-context.d.ts +58 -0
- package/dist/statements/control/conditionals/branch-context.d.ts.map +1 -0
- package/dist/statements/control/conditionals/branch-context.js +530 -0
- package/dist/statements/control/conditionals/branch-context.js.map +1 -0
- package/dist/statements/control/conditionals/branch-context.test.d.ts +2 -0
- package/dist/statements/control/conditionals/branch-context.test.d.ts.map +1 -0
- package/dist/statements/control/conditionals/branch-context.test.js +34 -0
- package/dist/statements/control/conditionals/branch-context.test.js.map +1 -0
- package/dist/statements/control/conditionals/guard-analysis.d.ts +8 -208
- package/dist/statements/control/conditionals/guard-analysis.d.ts.map +1 -1
- package/dist/statements/control/conditionals/guard-analysis.js +8 -763
- package/dist/statements/control/conditionals/guard-analysis.js.map +1 -1
- package/dist/statements/control/conditionals/guard-detectors-discriminant.d.ts +20 -0
- package/dist/statements/control/conditionals/guard-detectors-discriminant.d.ts.map +1 -0
- package/dist/statements/control/conditionals/guard-detectors-discriminant.js +214 -0
- package/dist/statements/control/conditionals/guard-detectors-discriminant.js.map +1 -0
- package/dist/statements/control/conditionals/guard-detectors-structural.d.ts +32 -0
- package/dist/statements/control/conditionals/guard-detectors-structural.d.ts.map +1 -0
- package/dist/statements/control/conditionals/guard-detectors-structural.js +302 -0
- package/dist/statements/control/conditionals/guard-detectors-structural.js.map +1 -0
- package/dist/statements/control/conditionals/guard-detectors.d.ts +11 -0
- package/dist/statements/control/conditionals/guard-detectors.d.ts.map +1 -0
- package/dist/statements/control/conditionals/guard-detectors.js +11 -0
- package/dist/statements/control/conditionals/guard-detectors.js.map +1 -0
- package/dist/statements/control/conditionals/guard-extraction.d.ts +30 -0
- package/dist/statements/control/conditionals/guard-extraction.d.ts.map +1 -0
- package/dist/statements/control/conditionals/guard-extraction.js +304 -0
- package/dist/statements/control/conditionals/guard-extraction.js.map +1 -0
- package/dist/statements/control/conditionals/guard-types.d.ts +214 -0
- package/dist/statements/control/conditionals/guard-types.d.ts.map +1 -0
- package/dist/statements/control/conditionals/guard-types.js +242 -0
- package/dist/statements/control/conditionals/guard-types.js.map +1 -0
- package/dist/statements/control/conditionals/if-emit-instanceof-guards.d.ts +28 -0
- package/dist/statements/control/conditionals/if-emit-instanceof-guards.d.ts.map +1 -0
- package/dist/statements/control/conditionals/if-emit-instanceof-guards.js +261 -0
- package/dist/statements/control/conditionals/if-emit-instanceof-guards.js.map +1 -0
- package/dist/statements/control/conditionals/if-emit-predicate-guards.d.ts +24 -0
- package/dist/statements/control/conditionals/if-emit-predicate-guards.d.ts.map +1 -0
- package/dist/statements/control/conditionals/if-emit-predicate-guards.js +165 -0
- package/dist/statements/control/conditionals/if-emit-predicate-guards.js.map +1 -0
- package/dist/statements/control/conditionals/if-emit-property-discriminant-guards.d.ts +24 -0
- package/dist/statements/control/conditionals/if-emit-property-discriminant-guards.d.ts.map +1 -0
- package/dist/statements/control/conditionals/if-emit-property-discriminant-guards.js +391 -0
- package/dist/statements/control/conditionals/if-emit-property-discriminant-guards.js.map +1 -0
- package/dist/statements/control/conditionals/if-emit-type-guards.d.ts +10 -0
- package/dist/statements/control/conditionals/if-emit-type-guards.d.ts.map +1 -0
- package/dist/statements/control/conditionals/if-emit-type-guards.js +10 -0
- package/dist/statements/control/conditionals/if-emit-type-guards.js.map +1 -0
- package/dist/statements/control/conditionals/if-emit-typeof-array-guards.d.ts +23 -0
- package/dist/statements/control/conditionals/if-emit-typeof-array-guards.d.ts.map +1 -0
- package/dist/statements/control/conditionals/if-emit-typeof-array-guards.js +264 -0
- package/dist/statements/control/conditionals/if-emit-typeof-array-guards.js.map +1 -0
- package/dist/statements/control/conditionals/if-emit-union-guards.d.ts +10 -0
- package/dist/statements/control/conditionals/if-emit-union-guards.d.ts.map +1 -0
- package/dist/statements/control/conditionals/if-emit-union-guards.js +10 -0
- package/dist/statements/control/conditionals/if-emit-union-guards.js.map +1 -0
- package/dist/statements/control/conditionals/if-emitter.d.ts +6 -3
- package/dist/statements/control/conditionals/if-emitter.d.ts.map +1 -1
- package/dist/statements/control/conditionals/if-emitter.js +99 -916
- package/dist/statements/control/conditionals/if-emitter.js.map +1 -1
- package/dist/statements/control/exceptions.d.ts.map +1 -1
- package/dist/statements/control/exceptions.js +19 -2
- package/dist/statements/control/exceptions.js.map +1 -1
- package/dist/statements/control/loop-helpers.d.ts +13 -0
- package/dist/statements/control/loop-helpers.d.ts.map +1 -0
- package/dist/statements/control/loop-helpers.js +75 -0
- package/dist/statements/control/loop-helpers.js.map +1 -0
- package/dist/statements/control/loops.d.ts.map +1 -1
- package/dist/statements/control/loops.js +85 -169
- package/dist/statements/control/loops.js.map +1 -1
- package/dist/statements/declarations/class-emitter-helpers.d.ts +17 -0
- package/dist/statements/declarations/class-emitter-helpers.d.ts.map +1 -0
- package/dist/statements/declarations/class-emitter-helpers.js +126 -0
- package/dist/statements/declarations/class-emitter-helpers.js.map +1 -0
- package/dist/statements/declarations/classes.d.ts.map +1 -1
- package/dist/statements/declarations/classes.js +102 -27
- package/dist/statements/declarations/classes.js.map +1 -1
- package/dist/statements/declarations/function-local-emitter.d.ts +7 -0
- package/dist/statements/declarations/function-local-emitter.d.ts.map +1 -0
- package/dist/statements/declarations/function-local-emitter.js +363 -0
- package/dist/statements/declarations/function-local-emitter.js.map +1 -0
- package/dist/statements/declarations/function-module-emitter.d.ts +7 -0
- package/dist/statements/declarations/function-module-emitter.d.ts.map +1 -0
- package/dist/statements/declarations/function-module-emitter.js +372 -0
- package/dist/statements/declarations/function-module-emitter.js.map +1 -0
- package/dist/statements/declarations/function-shared.d.ts +43 -0
- package/dist/statements/declarations/function-shared.d.ts.map +1 -0
- package/dist/statements/declarations/function-shared.js +246 -0
- package/dist/statements/declarations/function-shared.js.map +1 -0
- package/dist/statements/declarations/functions.d.ts +2 -27
- package/dist/statements/declarations/functions.d.ts.map +1 -1
- package/dist/statements/declarations/functions.js +2 -709
- package/dist/statements/declarations/functions.js.map +1 -1
- package/dist/statements/declarations/interfaces.d.ts.map +1 -1
- package/dist/statements/declarations/interfaces.js +25 -9
- package/dist/statements/declarations/interfaces.js.map +1 -1
- package/dist/statements/declarations/type-aliases.d.ts.map +1 -1
- package/dist/statements/declarations/type-aliases.js +3 -4
- package/dist/statements/declarations/type-aliases.js.map +1 -1
- package/dist/statements/declarations/variable-local-type.d.ts +36 -0
- package/dist/statements/declarations/variable-local-type.d.ts.map +1 -0
- package/dist/statements/declarations/variable-local-type.js +122 -0
- package/dist/statements/declarations/variable-local-type.js.map +1 -0
- package/dist/statements/declarations/variable-static-arrow.d.ts +47 -0
- package/dist/statements/declarations/variable-static-arrow.d.ts.map +1 -0
- package/dist/statements/declarations/variable-static-arrow.js +363 -0
- package/dist/statements/declarations/variable-static-arrow.js.map +1 -0
- package/dist/statements/declarations/variable-type-helpers.d.ts +86 -0
- package/dist/statements/declarations/variable-type-helpers.d.ts.map +1 -0
- package/dist/statements/declarations/variable-type-helpers.js +242 -0
- package/dist/statements/declarations/variable-type-helpers.js.map +1 -0
- package/dist/statements/declarations/variable-type-resolution.d.ts +11 -0
- package/dist/statements/declarations/variable-type-resolution.d.ts.map +1 -0
- package/dist/statements/declarations/variable-type-resolution.js +11 -0
- package/dist/statements/declarations/variable-type-resolution.js.map +1 -0
- package/dist/statements/declarations/variables.d.ts +5 -1
- package/dist/statements/declarations/variables.d.ts.map +1 -1
- package/dist/statements/declarations/variables.js +116 -596
- package/dist/statements/declarations/variables.js.map +1 -1
- package/dist/statements/index.test.d.ts +10 -5
- package/dist/statements/index.test.d.ts.map +1 -1
- package/dist/statements/index.test.js +10 -1969
- package/dist/statements/index.test.js.map +1 -1
- package/dist/statements/parameter-defaults.d.ts +17 -0
- package/dist/statements/parameter-defaults.d.ts.map +1 -0
- package/dist/statements/parameter-defaults.js +122 -0
- package/dist/statements/parameter-defaults.js.map +1 -0
- package/dist/statements/statement-cases/async-returns.test.d.ts +2 -0
- package/dist/statements/statement-cases/async-returns.test.d.ts.map +1 -0
- package/dist/statements/statement-cases/async-returns.test.js +311 -0
- package/dist/statements/statement-cases/async-returns.test.js.map +1 -0
- package/dist/statements/statement-cases/flow-and-void.test.d.ts +2 -0
- package/dist/statements/statement-cases/flow-and-void.test.d.ts.map +1 -0
- package/dist/statements/statement-cases/flow-and-void.test.js +405 -0
- package/dist/statements/statement-cases/flow-and-void.test.js.map +1 -0
- package/dist/statements/statement-cases/helpers.d.ts +6 -0
- package/dist/statements/statement-cases/helpers.d.ts.map +1 -0
- package/dist/statements/statement-cases/helpers.js +4 -0
- package/dist/statements/statement-cases/helpers.js.map +1 -0
- package/dist/statements/statement-cases/if-and-instanceof-guards.test.d.ts +2 -0
- package/dist/statements/statement-cases/if-and-instanceof-guards.test.d.ts.map +1 -0
- package/dist/statements/statement-cases/if-and-instanceof-guards.test.js +826 -0
- package/dist/statements/statement-cases/if-and-instanceof-guards.test.js.map +1 -0
- package/dist/statements/statement-cases/loops.test.d.ts +2 -0
- package/dist/statements/statement-cases/loops.test.d.ts.map +1 -0
- package/dist/statements/statement-cases/loops.test.js +433 -0
- package/dist/statements/statement-cases/loops.test.js.map +1 -0
- package/dist/statements/statement-cases/scopes-and-storage.test.d.ts +2 -0
- package/dist/statements/statement-cases/scopes-and-storage.test.d.ts.map +1 -0
- package/dist/statements/statement-cases/scopes-and-storage.test.js +216 -0
- package/dist/statements/statement-cases/scopes-and-storage.test.js.map +1 -0
- package/dist/statements/statement-cases/union-guards-basic.test.d.ts +2 -0
- package/dist/statements/statement-cases/union-guards-basic.test.d.ts.map +1 -0
- package/dist/statements/statement-cases/union-guards-basic.test.js +235 -0
- package/dist/statements/statement-cases/union-guards-basic.test.js.map +1 -0
- package/dist/statements/statement-cases/union-guards-nullish-and-object.test.d.ts +2 -0
- package/dist/statements/statement-cases/union-guards-nullish-and-object.test.d.ts.map +1 -0
- package/dist/statements/statement-cases/union-guards-nullish-and-object.test.js +265 -0
- package/dist/statements/statement-cases/union-guards-nullish-and-object.test.js.map +1 -0
- package/dist/statements/statement-cases/union-guards-predicate-and-truthy.test.d.ts +2 -0
- package/dist/statements/statement-cases/union-guards-predicate-and-truthy.test.d.ts.map +1 -0
- package/dist/statements/statement-cases/union-guards-predicate-and-truthy.test.js +630 -0
- package/dist/statements/statement-cases/union-guards-predicate-and-truthy.test.js.map +1 -0
- package/dist/statements/statement-cases/union-guards-remapped-a.test.d.ts +2 -0
- package/dist/statements/statement-cases/union-guards-remapped-a.test.d.ts.map +1 -0
- package/dist/statements/statement-cases/union-guards-remapped-a.test.js +382 -0
- package/dist/statements/statement-cases/union-guards-remapped-a.test.js.map +1 -0
- package/dist/statements/statement-cases/union-guards-remapped-b.test.d.ts +2 -0
- package/dist/statements/statement-cases/union-guards-remapped-b.test.d.ts.map +1 -0
- package/dist/statements/statement-cases/union-guards-remapped-b.test.js +397 -0
- package/dist/statements/statement-cases/union-guards-remapped-b.test.js.map +1 -0
- package/dist/type-assertion.test.js +258 -10
- package/dist/type-assertion.test.js.map +1 -1
- package/dist/types/arrays.d.ts.map +1 -1
- package/dist/types/arrays.js +10 -1
- package/dist/types/arrays.js.map +1 -1
- package/dist/types/emitter.d.ts.map +1 -1
- package/dist/types/emitter.js +129 -24
- package/dist/types/emitter.js.map +1 -1
- package/dist/types/index.test.js +205 -1
- package/dist/types/index.test.js.map +1 -1
- package/dist/types/objects.d.ts +2 -2
- package/dist/types/objects.d.ts.map +1 -1
- package/dist/types/objects.js +2 -2
- package/dist/types/objects.js.map +1 -1
- package/dist/types/parameters.d.ts.map +1 -1
- package/dist/types/parameters.js +88 -18
- package/dist/types/parameters.js.map +1 -1
- package/dist/types/reference-lookup.d.ts +16 -0
- package/dist/types/reference-lookup.d.ts.map +1 -0
- package/dist/types/reference-lookup.js +133 -0
- package/dist/types/reference-lookup.js.map +1 -0
- package/dist/types/reference-structural-signatures.d.ts +10 -0
- package/dist/types/reference-structural-signatures.d.ts.map +1 -0
- package/dist/types/reference-structural-signatures.js +310 -0
- package/dist/types/reference-structural-signatures.js.map +1 -0
- package/dist/types/references-cases/array-and-cross-module.test.d.ts +2 -0
- package/dist/types/references-cases/array-and-cross-module.test.d.ts.map +1 -0
- package/dist/types/references-cases/array-and-cross-module.test.js +150 -0
- package/dist/types/references-cases/array-and-cross-module.test.js.map +1 -0
- package/dist/types/references-cases/bindings-and-local.test.d.ts +2 -0
- package/dist/types/references-cases/bindings-and-local.test.d.ts.map +1 -0
- package/dist/types/references-cases/bindings-and-local.test.js +368 -0
- package/dist/types/references-cases/bindings-and-local.test.js.map +1 -0
- package/dist/types/references-cases/helpers.d.ts +14 -0
- package/dist/types/references-cases/helpers.d.ts.map +1 -0
- package/dist/types/references-cases/helpers.js +39 -0
- package/dist/types/references-cases/helpers.js.map +1 -0
- package/dist/types/references-cases/polymorphic-and-recursive.test.d.ts +2 -0
- package/dist/types/references-cases/polymorphic-and-recursive.test.d.ts.map +1 -0
- package/dist/types/references-cases/polymorphic-and-recursive.test.js +387 -0
- package/dist/types/references-cases/polymorphic-and-recursive.test.js.map +1 -0
- package/dist/types/references-cases/primitive-and-builtins.test.d.ts +2 -0
- package/dist/types/references-cases/primitive-and-builtins.test.d.ts.map +1 -0
- package/dist/types/references-cases/primitive-and-builtins.test.js +116 -0
- package/dist/types/references-cases/primitive-and-builtins.test.js.map +1 -0
- package/dist/types/references-cases/resolved-and-imported.test.d.ts +2 -0
- package/dist/types/references-cases/resolved-and-imported.test.d.ts.map +1 -0
- package/dist/types/references-cases/resolved-and-imported.test.js +669 -0
- package/dist/types/references-cases/resolved-and-imported.test.js.map +1 -0
- package/dist/types/references.d.ts.map +1 -1
- package/dist/types/references.js +250 -154
- package/dist/types/references.js.map +1 -1
- package/dist/types/references.test.d.ts +5 -10
- package/dist/types/references.test.d.ts.map +1 -1
- package/dist/types/references.test.js +5 -730
- package/dist/types/references.test.js.map +1 -1
- package/dist/types/unions-cases/basic-and-ordering.test.d.ts +6 -0
- package/dist/types/unions-cases/basic-and-ordering.test.d.ts.map +1 -0
- package/dist/types/unions-cases/basic-and-ordering.test.js +322 -0
- package/dist/types/unions-cases/basic-and-ordering.test.js.map +1 -0
- package/dist/types/unions-cases/large-and-fallback.test.d.ts +6 -0
- package/dist/types/unions-cases/large-and-fallback.test.d.ts.map +1 -0
- package/dist/types/unions-cases/large-and-fallback.test.js +246 -0
- package/dist/types/unions-cases/large-and-fallback.test.js.map +1 -0
- package/dist/types/unions-cases/multi-surface.test.d.ts +6 -0
- package/dist/types/unions-cases/multi-surface.test.d.ts.map +1 -0
- package/dist/types/unions-cases/multi-surface.test.js +268 -0
- package/dist/types/unions-cases/multi-surface.test.js.map +1 -0
- package/dist/types/unions.d.ts +1 -1
- package/dist/types/unions.d.ts.map +1 -1
- package/dist/types/unions.js +60 -65
- package/dist/types/unions.js.map +1 -1
- package/dist/types/unions.test.d.ts +3 -5
- package/dist/types/unions.test.d.ts.map +1 -1
- package/dist/types/unions.test.js +3 -413
- package/dist/types/unions.test.js.map +1 -1
- package/package.json +4 -4
package/dist/integration.test.js
CHANGED
|
@@ -1,1224 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { buildIrModule, DotnetMetadataRegistry, createClrBindingsResolver, createBinding, createProgramContext, loadBindings, runAnonymousTypeLoweringPass, runAttributeCollectionPass, runNumericProofPass, } from "@tsonic/frontend";
|
|
11
|
-
import { emitCSharpFiles } from "./emitter.js";
|
|
12
|
-
const require = createRequire(import.meta.url);
|
|
13
|
-
const corePackageRoot = path.dirname(require.resolve("@tsonic/core/package.json"));
|
|
14
|
-
const coreTypesPath = path.join(corePackageRoot, "types.d.ts");
|
|
15
|
-
const coreLangPath = path.join(corePackageRoot, "lang.d.ts");
|
|
16
|
-
const resolveTsonicModule = (moduleName) => {
|
|
17
|
-
if (!moduleName.startsWith("@tsonic/")) {
|
|
18
|
-
return undefined;
|
|
19
|
-
}
|
|
20
|
-
const parts = moduleName.split("/");
|
|
21
|
-
if (parts.length < 2) {
|
|
22
|
-
return undefined;
|
|
23
|
-
}
|
|
24
|
-
const packageName = parts.slice(0, 2).join("/");
|
|
25
|
-
const packageRoot = path.dirname(require.resolve(`${packageName}/package.json`));
|
|
26
|
-
const subPath = moduleName.slice(packageName.length + 1);
|
|
27
|
-
const declarationPath = path.join(packageRoot, subPath.replace(/\.js$/, ".d.ts"));
|
|
28
|
-
return {
|
|
29
|
-
filePath: declarationPath,
|
|
30
|
-
packageRoot,
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Helper to compile TypeScript source to C#
|
|
35
|
-
*/
|
|
36
|
-
const compileToCSharp = (source, fileName = "/test/test.ts") => {
|
|
37
|
-
const resolvedPackageRoots = new Set();
|
|
38
|
-
// Phase 5: Each test creates fresh ProgramContext - no global cleanup needed
|
|
39
|
-
const sourceFile = ts.createSourceFile(fileName, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
40
|
-
const compilerOptions = {
|
|
41
|
-
target: ts.ScriptTarget.ES2022,
|
|
42
|
-
module: ts.ModuleKind.NodeNext,
|
|
43
|
-
moduleResolution: ts.ModuleResolutionKind.NodeNext,
|
|
44
|
-
strict: true,
|
|
45
|
-
noEmit: true,
|
|
46
|
-
noLib: true,
|
|
47
|
-
skipLibCheck: true,
|
|
48
|
-
allowImportingTsExtensions: true,
|
|
49
|
-
};
|
|
50
|
-
const host = ts.createCompilerHost(compilerOptions);
|
|
51
|
-
const originalGetSourceFile = host.getSourceFile;
|
|
52
|
-
const originalResolveModuleNames = host.resolveModuleNames?.bind(host);
|
|
53
|
-
host.getSourceFile = (name, languageVersionOrOptions, onError, shouldCreateNewSourceFile) => {
|
|
54
|
-
if (name === fileName) {
|
|
55
|
-
return sourceFile;
|
|
56
|
-
}
|
|
57
|
-
return originalGetSourceFile.call(host, name, languageVersionOrOptions, onError, shouldCreateNewSourceFile);
|
|
58
|
-
};
|
|
59
|
-
host.resolveModuleNames = (moduleNames, containingFile, reusedNames, redirectedReference, options) => {
|
|
60
|
-
const resolutionOptions = options ?? compilerOptions;
|
|
61
|
-
return moduleNames.map((moduleName) => {
|
|
62
|
-
const resolvedTsonicModule = moduleName === "@tsonic/core/types.js"
|
|
63
|
-
? { filePath: coreTypesPath, packageRoot: corePackageRoot }
|
|
64
|
-
: moduleName === "@tsonic/core/lang.js"
|
|
65
|
-
? { filePath: coreLangPath, packageRoot: corePackageRoot }
|
|
66
|
-
: resolveTsonicModule(moduleName);
|
|
67
|
-
if (resolvedTsonicModule) {
|
|
68
|
-
resolvedPackageRoots.add(resolvedTsonicModule.packageRoot);
|
|
69
|
-
return {
|
|
70
|
-
resolvedFileName: resolvedTsonicModule.filePath,
|
|
71
|
-
extension: ts.Extension.Dts,
|
|
72
|
-
isExternalLibraryImport: true,
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
return (originalResolveModuleNames?.([moduleName], containingFile, reusedNames, redirectedReference, resolutionOptions)?.[0] ??
|
|
76
|
-
ts.resolveModuleName(moduleName, containingFile, resolutionOptions, host).resolvedModule);
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
const tsProgram = ts.createProgram([fileName], compilerOptions, host);
|
|
80
|
-
const checker = tsProgram.getTypeChecker();
|
|
81
|
-
const tsonicProgram = {
|
|
82
|
-
program: tsProgram,
|
|
83
|
-
checker,
|
|
84
|
-
binding: createBinding(checker),
|
|
85
|
-
options: {
|
|
86
|
-
projectRoot: "/test",
|
|
87
|
-
sourceRoot: "/test",
|
|
88
|
-
rootNamespace: "Test",
|
|
89
|
-
},
|
|
90
|
-
sourceFiles: [sourceFile],
|
|
91
|
-
declarationSourceFiles: [],
|
|
92
|
-
metadata: new DotnetMetadataRegistry(),
|
|
93
|
-
bindings: loadBindings(Array.from(resolvedPackageRoots)),
|
|
94
|
-
clrResolver: createClrBindingsResolver("/test"),
|
|
95
|
-
};
|
|
96
|
-
// Phase 5: Create ProgramContext for this compilation
|
|
97
|
-
const options = { sourceRoot: "/test", rootNamespace: "Test" };
|
|
98
|
-
const ctx = createProgramContext(tsonicProgram, options);
|
|
99
|
-
// Build IR
|
|
100
|
-
const irResult = buildIrModule(sourceFile, tsonicProgram, options, ctx);
|
|
101
|
-
if (!irResult.ok) {
|
|
102
|
-
throw new Error(`IR build failed: ${irResult.error.message}`);
|
|
103
|
-
}
|
|
104
|
-
// Integration tests emit directly from a single built module, so they must
|
|
105
|
-
// still run the frontend lowering/validation passes required by the emitter
|
|
106
|
-
// contract instead of bypassing them with raw builder output.
|
|
107
|
-
const loweredModules = runAnonymousTypeLoweringPass([irResult.value]).modules;
|
|
108
|
-
const proofResult = runNumericProofPass(loweredModules);
|
|
109
|
-
if (!proofResult.ok) {
|
|
110
|
-
throw new Error(`Numeric proof validation failed: ${proofResult.diagnostics.map((d) => d.message).join("; ")}`);
|
|
111
|
-
}
|
|
112
|
-
const attributeResult = runAttributeCollectionPass(proofResult.modules);
|
|
113
|
-
if (!attributeResult.ok) {
|
|
114
|
-
throw new Error(`Attribute collection failed: ${attributeResult.diagnostics.map((d) => d.message).join("; ")}`);
|
|
115
|
-
}
|
|
116
|
-
const emitResult = emitCSharpFiles(attributeResult.modules, {
|
|
117
|
-
rootNamespace: "Test",
|
|
118
|
-
});
|
|
119
|
-
if (!emitResult.ok) {
|
|
120
|
-
throw new Error(`Emit failed: ${emitResult.errors.map((d) => d.message).join("; ")}`);
|
|
121
|
-
}
|
|
122
|
-
return [...emitResult.files.entries()]
|
|
123
|
-
.sort(([a], [b]) => a.localeCompare(b))
|
|
124
|
-
.map(([, code]) => code)
|
|
125
|
-
.join("\n\n");
|
|
126
|
-
};
|
|
127
|
-
describe("End-to-End Integration", () => {
|
|
128
|
-
describe("Arrow Field Delegates", () => {
|
|
129
|
-
it("should emit Action for static void arrow fields (never Func<void>)", () => {
|
|
130
|
-
const source = `
|
|
131
|
-
export const noop: () => void = () => {};
|
|
132
|
-
`;
|
|
133
|
-
const csharp = compileToCSharp(source);
|
|
134
|
-
expect(csharp).to.match(/public\s+static\s+readonly\s+global::System\.Action\s+noop\s*=/);
|
|
135
|
-
expect(csharp).not.to.match(/global::System\.Func\s*<\s*void\s*>/);
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
describe("Generic Functions", () => {
|
|
139
|
-
it("should compile generic identity function to C#", () => {
|
|
140
|
-
const source = `
|
|
141
|
-
export function identity<T>(value: T): T {
|
|
142
|
-
return value;
|
|
143
|
-
}
|
|
144
|
-
`;
|
|
145
|
-
const csharp = compileToCSharp(source);
|
|
146
|
-
// Should emit generic function signature
|
|
147
|
-
expect(csharp).to.match(/public\s+static\s+T\s+identity\s*<T>/);
|
|
148
|
-
expect(csharp).to.include("(T value)");
|
|
149
|
-
expect(csharp).to.include("return value;");
|
|
150
|
-
});
|
|
151
|
-
it("should compile generic function with type alias constraint", () => {
|
|
152
|
-
const source = `
|
|
153
|
-
type HasId = { id: number };
|
|
154
|
-
|
|
155
|
-
export function getId<T extends HasId>(obj: T): number {
|
|
156
|
-
return obj.id;
|
|
157
|
-
}
|
|
158
|
-
`;
|
|
159
|
-
const csharp = compileToCSharp(source);
|
|
160
|
-
// Should emit type alias as class
|
|
161
|
-
expect(csharp).to.include("class HasId__Alias");
|
|
162
|
-
expect(csharp).to.match(/required\s+double\s+id\s*\{\s*get;\s*set;/);
|
|
163
|
-
// Should use type alias as constraint
|
|
164
|
-
expect(csharp).to.include("where T : HasId");
|
|
165
|
-
// Should have function
|
|
166
|
-
expect(csharp).to.match(/public\s+static\s+double\s+getId<T>/);
|
|
167
|
-
});
|
|
168
|
-
it("should not emit invalid C# constraints for primitive-like TS constraints", () => {
|
|
169
|
-
const source = `
|
|
170
|
-
export interface User {
|
|
171
|
-
name: string;
|
|
172
|
-
age: number;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export type UserKey = keyof User;
|
|
176
|
-
export type UserValue<K extends UserKey> = User[K];
|
|
177
|
-
export type RoutePath<T extends string> = \`/api/\${T}\`;
|
|
178
|
-
`;
|
|
179
|
-
const csharp = compileToCSharp(source);
|
|
180
|
-
expect(csharp).to.not.match(/where\s+\w+\s*:\s*string/);
|
|
181
|
-
expect(csharp).to.not.include("where K : string");
|
|
182
|
-
expect(csharp).to.not.include("where T : string");
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
describe("Interfaces and Type Aliases", () => {
|
|
186
|
-
it("should compile interface to C# class", () => {
|
|
187
|
-
const source = `
|
|
188
|
-
export interface User {
|
|
189
|
-
id: number;
|
|
190
|
-
name: string;
|
|
191
|
-
email?: string;
|
|
192
|
-
}
|
|
193
|
-
`;
|
|
194
|
-
const csharp = compileToCSharp(source);
|
|
195
|
-
// Should emit C# class (not interface)
|
|
196
|
-
expect(csharp).to.match(/public\s+class\s+User/);
|
|
197
|
-
expect(csharp).not.to.include("interface User");
|
|
198
|
-
// Should have auto-properties (required for non-optional)
|
|
199
|
-
expect(csharp).to.match(/public\s+required\s+double\s+id\s*\{\s*get;\s*set;/);
|
|
200
|
-
expect(csharp).to.match(/public\s+required\s+string\s+name\s*\{\s*get;\s*set;/);
|
|
201
|
-
// Optional property should be nullable
|
|
202
|
-
expect(csharp).to.match(/public\s+string\?\s+email\s*\{\s*get;\s*set;/);
|
|
203
|
-
expect(csharp).to.match(/\[global::System\.Diagnostics\.CodeAnalysis\.SetsRequiredMembersAttribute\]\s*public\s+User\s*\(\s*\)/);
|
|
204
|
-
});
|
|
205
|
-
it("should compile structural type alias to sealed class", () => {
|
|
206
|
-
const source = `
|
|
207
|
-
export type Point = {
|
|
208
|
-
x: number;
|
|
209
|
-
y: number;
|
|
210
|
-
};
|
|
211
|
-
`;
|
|
212
|
-
const csharp = compileToCSharp(source);
|
|
213
|
-
// Should emit sealed class with __Alias suffix
|
|
214
|
-
expect(csharp).to.match(/public\s+sealed\s+class\s+Point__Alias/);
|
|
215
|
-
expect(csharp).to.match(/public\s+required\s+double\s+x\s*\{\s*get;\s*set;/);
|
|
216
|
-
expect(csharp).to.match(/public\s+required\s+double\s+y\s*\{\s*get;\s*set;/);
|
|
217
|
-
expect(csharp).to.match(/\[global::System\.Diagnostics\.CodeAnalysis\.SetsRequiredMembersAttribute\]\s*public\s+Point__Alias\s*\(\s*\)/);
|
|
218
|
-
});
|
|
219
|
-
it("should compile generic interface", () => {
|
|
220
|
-
const source = `
|
|
221
|
-
export interface Result<T> {
|
|
222
|
-
ok: boolean;
|
|
223
|
-
value: T;
|
|
224
|
-
}
|
|
225
|
-
`;
|
|
226
|
-
const csharp = compileToCSharp(source);
|
|
227
|
-
// Should emit generic class
|
|
228
|
-
expect(csharp).to.match(/public\s+class\s+Result\s*<T>/);
|
|
229
|
-
expect(csharp).to.match(/public\s+required\s+bool\s+ok/);
|
|
230
|
-
expect(csharp).to.match(/public\s+required\s+T\s+value/);
|
|
231
|
-
expect(csharp).to.match(/\[global::System\.Diagnostics\.CodeAnalysis\.SetsRequiredMembersAttribute\]\s*public\s+Result\s*\(\s*\)/);
|
|
232
|
-
});
|
|
233
|
-
});
|
|
234
|
-
describe("Generic Classes", () => {
|
|
235
|
-
it("should compile generic class with methods", () => {
|
|
236
|
-
const source = `
|
|
237
|
-
export class Container<T> {
|
|
238
|
-
constructor(private value: T) {}
|
|
239
|
-
|
|
240
|
-
getValue(): T {
|
|
241
|
-
return this.value;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
setValue(newValue: T): void {
|
|
245
|
-
this.value = newValue;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
`;
|
|
249
|
-
const csharp = compileToCSharp(source);
|
|
250
|
-
// Should emit generic class
|
|
251
|
-
expect(csharp).to.match(/public\s+class\s+Container\s*<T>/);
|
|
252
|
-
// Should have generic methods
|
|
253
|
-
expect(csharp).to.match(/public\s+T\s+getValue\s*\(\s*\)/);
|
|
254
|
-
expect(csharp).to.match(/public\s+void\s+setValue\s*\(\s*T\s+newValue\s*\)/);
|
|
255
|
-
});
|
|
256
|
-
});
|
|
257
|
-
describe("Combined Features", () => {
|
|
258
|
-
it("should compile code with multiple generic features", () => {
|
|
259
|
-
const source = `
|
|
260
|
-
import { int } from "@tsonic/core/types.js";
|
|
261
|
-
|
|
262
|
-
export interface Repository<T> {
|
|
263
|
-
items: T[];
|
|
264
|
-
add(item: T): void;
|
|
265
|
-
findById(id: number): T | undefined;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
export class InMemoryRepository<T extends { id: number }> {
|
|
269
|
-
private items: T[] = [];
|
|
270
|
-
|
|
271
|
-
add(item: T): void {
|
|
272
|
-
this.items.push(item);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
findById(id: number): T | undefined {
|
|
276
|
-
for (let i: int = 0; i < this.items.Length; i++) {
|
|
277
|
-
if (this.items[i].id === id) {
|
|
278
|
-
return this.items[i];
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
return undefined;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
`;
|
|
285
|
-
const csharp = compileToCSharp(source);
|
|
286
|
-
// Method-bearing interfaces emit as C# interfaces (required for constraints/implements)
|
|
287
|
-
expect(csharp).to.match(/public\s+interface\s+Repository\s*<T>/);
|
|
288
|
-
// Should emit InMemoryRepository as generic class with constraint
|
|
289
|
-
expect(csharp).to.match(/public\s+class\s+InMemoryRepository\s*<T>/);
|
|
290
|
-
expect(csharp).to.include("where T : __Constraint_T");
|
|
291
|
-
// Should generate constraint adapter
|
|
292
|
-
expect(csharp).to.match(/public\s+interface\s+__Constraint_T/);
|
|
293
|
-
expect(csharp).to.match(/double\s+id\s*\{\s*get;\s*\}/);
|
|
294
|
-
});
|
|
295
|
-
});
|
|
296
|
-
describe("Lambda Parameter Type Inference", () => {
|
|
297
|
-
it("should infer types for Promise executor callback parameters", () => {
|
|
298
|
-
const source = `
|
|
299
|
-
// Inline minimal types for this test
|
|
300
|
-
declare function setTimeout(fn: () => void, ms: number): void;
|
|
301
|
-
declare class Promise<T> {
|
|
302
|
-
constructor(executor: (resolve: () => void) => void);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
export function delay(ms: number): Promise<void> {
|
|
306
|
-
return new Promise((resolve) => {
|
|
307
|
-
setTimeout(resolve, ms);
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
`;
|
|
311
|
-
const csharp = compileToCSharp(source);
|
|
312
|
-
// Should emit lambda with typed resolve parameter (function type becomes Action)
|
|
313
|
-
// The key is that resolve has a type annotation, not just the bare identifier
|
|
314
|
-
expect(csharp).to.match(/\(global::System\.Action.*\s+resolve\)\s*=>/);
|
|
315
|
-
});
|
|
316
|
-
it("infers Promise constructor generic from contextual return type", () => {
|
|
317
|
-
const source = `
|
|
318
|
-
declare function setTimeout(fn: () => void, ms: number): void;
|
|
319
|
-
|
|
320
|
-
interface PromiseLike<T> {
|
|
321
|
-
then<TResult1 = T, TResult2 = never>(
|
|
322
|
-
onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null,
|
|
323
|
-
onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | undefined | null
|
|
324
|
-
): PromiseLike<TResult1 | TResult2>;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
declare class Promise<T> {
|
|
328
|
-
constructor(
|
|
329
|
-
executor: (
|
|
330
|
-
resolve: (value: T | PromiseLike<T>) => void,
|
|
331
|
-
reject: (reason: unknown) => void
|
|
332
|
-
) => void
|
|
333
|
-
);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
export function delay(ms: number): Promise<void> {
|
|
337
|
-
return new Promise((resolve) => {
|
|
338
|
-
setTimeout(() => resolve(), ms);
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
`;
|
|
342
|
-
const csharp = compileToCSharp(source);
|
|
343
|
-
expect(csharp).to.include("TaskCompletionSource<bool>");
|
|
344
|
-
expect(csharp).to.match(/\(\(global::System\.Action<global::System\.Action>\)\(resolve\s*=>/);
|
|
345
|
-
expect(csharp).not.to.include("new Promise(");
|
|
346
|
-
});
|
|
347
|
-
it("should infer types for generic method callbacks", () => {
|
|
348
|
-
const source = `
|
|
349
|
-
// Custom generic class with map method (valid in dotnet mode)
|
|
350
|
-
export class Box<T> {
|
|
351
|
-
value: T;
|
|
352
|
-
constructor(value: T) {
|
|
353
|
-
this.value = value;
|
|
354
|
-
}
|
|
355
|
-
map<U>(fn: (x: T) => U): Box<U> {
|
|
356
|
-
return new Box<U>(fn(this.value));
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
export function doubleBox(box: Box<number>): Box<number> {
|
|
361
|
-
return box.map((n) => n * 2);
|
|
362
|
-
}
|
|
363
|
-
`;
|
|
364
|
-
const csharp = compileToCSharp(source);
|
|
365
|
-
// Should emit lambda with typed parameter
|
|
366
|
-
// n should be inferred as number (double in C#) from Box<number>.map's callback type
|
|
367
|
-
expect(csharp).to.include("(double n) => n * 2");
|
|
368
|
-
});
|
|
369
|
-
});
|
|
370
|
-
describe("Type Predicate Functions", () => {
|
|
371
|
-
it("should emit type predicate return type as bool", () => {
|
|
372
|
-
const source = `
|
|
373
|
-
export interface Dog {
|
|
374
|
-
type: "dog";
|
|
375
|
-
bark(): void;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
export type Animal = Dog;
|
|
379
|
-
|
|
380
|
-
export function isDog(animal: Animal): animal is Dog {
|
|
381
|
-
return animal.type === "dog";
|
|
382
|
-
}
|
|
383
|
-
`;
|
|
384
|
-
const csharp = compileToCSharp(source);
|
|
385
|
-
// Type predicate (animal is Dog) should emit as bool return type.
|
|
386
|
-
// Note: `Animal` is a TS type alias and does not become a C# type; the emitter
|
|
387
|
-
// resolves non-structural aliases at use sites, so the parameter type is `Dog`.
|
|
388
|
-
expect(csharp).to.match(/public\s+static\s+bool\s+isDog\s*\(\s*Dog\s+animal\s*\)/);
|
|
389
|
-
// Should not emit 'dynamic' (old broken behavior)
|
|
390
|
-
expect(csharp).not.to.include("dynamic isDog");
|
|
391
|
-
});
|
|
392
|
-
});
|
|
393
|
-
describe("Full Module Compilation", () => {
|
|
394
|
-
it("should compile a complete module with all features", () => {
|
|
395
|
-
const source = `
|
|
396
|
-
import { int } from "@tsonic/core/types.js";
|
|
397
|
-
|
|
398
|
-
// Type definitions
|
|
399
|
-
export interface User {
|
|
400
|
-
id: number;
|
|
401
|
-
name: string;
|
|
402
|
-
email?: string;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
export type UserId = number;
|
|
406
|
-
|
|
407
|
-
// User repository
|
|
408
|
-
export class UserRepository {
|
|
409
|
-
private users: User[] = [];
|
|
410
|
-
|
|
411
|
-
add(user: User): void {
|
|
412
|
-
this.users.push(user);
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
findById(id: UserId): User | undefined {
|
|
416
|
-
for (let i: int = 0; i < this.users.Length; i++) {
|
|
417
|
-
if (this.users[i].id === id) {
|
|
418
|
-
return this.users[i];
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
return undefined;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
all(): User[] {
|
|
425
|
-
return this.users;
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
// Generic utility function with manual iteration
|
|
430
|
-
export function transform<T, U>(arr: T[], fn: (item: T) => U): U[] {
|
|
431
|
-
const result: U[] = [];
|
|
432
|
-
for (let i: int = 0; i < arr.Length; i++) {
|
|
433
|
-
result.push(fn(arr[i]));
|
|
434
|
-
}
|
|
435
|
-
return result;
|
|
436
|
-
}
|
|
437
|
-
`;
|
|
438
|
-
const csharp = compileToCSharp(source);
|
|
439
|
-
// Should have all type definitions
|
|
440
|
-
expect(csharp).to.include("class User");
|
|
441
|
-
// Non-structural aliases are erased; usage sites should still resolve correctly.
|
|
442
|
-
expect(csharp).to.not.include("// type UserId = double");
|
|
443
|
-
expect(csharp).to.match(/findById\s*\(\s*double\s+id\s*\)/i);
|
|
444
|
-
// Should have the repository class
|
|
445
|
-
expect(csharp).to.include("class UserRepository");
|
|
446
|
-
// Should have the generic function with native array return type
|
|
447
|
-
expect(csharp).to.match(/public\s+static\s+U\[\]\s+transform\s*<T,\s*U>/);
|
|
448
|
-
// Should have proper namespace structure
|
|
449
|
-
expect(csharp).to.include("namespace Test");
|
|
450
|
-
expect(csharp).to.include("public static class test");
|
|
451
|
-
});
|
|
452
|
-
it("is deterministic across sequential compiles (no cross-program alias cache bleed)", () => {
|
|
453
|
-
const seedSource = `
|
|
454
|
-
export type UserId = string;
|
|
455
|
-
export function seed(id: UserId): UserId {
|
|
456
|
-
return id;
|
|
457
|
-
}
|
|
458
|
-
`;
|
|
459
|
-
const targetSource = `
|
|
460
|
-
export interface User {
|
|
461
|
-
id: number;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
export type UserId = number;
|
|
465
|
-
|
|
466
|
-
export class UserRepository {
|
|
467
|
-
findById(id: UserId): User | undefined {
|
|
468
|
-
return undefined;
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
`;
|
|
472
|
-
compileToCSharp(seedSource);
|
|
473
|
-
const csharp = compileToCSharp(targetSource);
|
|
474
|
-
expect(csharp).to.match(/findById\s*\(\s*double\s+id\s*\)/i);
|
|
475
|
-
});
|
|
476
|
-
it("does not leak structural alias property types across compiles", () => {
|
|
477
|
-
const seedSource = `
|
|
478
|
-
export type Payload = {
|
|
479
|
-
value: string;
|
|
480
|
-
};
|
|
481
|
-
`;
|
|
482
|
-
const targetSource = `
|
|
483
|
-
export type Payload = {
|
|
484
|
-
value: number;
|
|
485
|
-
};
|
|
486
|
-
|
|
487
|
-
export function read(input: Payload): number {
|
|
488
|
-
return input.value;
|
|
489
|
-
}
|
|
490
|
-
`;
|
|
491
|
-
compileToCSharp(seedSource);
|
|
492
|
-
const csharp = compileToCSharp(targetSource);
|
|
493
|
-
expect(csharp).to.match(/class\s+Payload__Alias[\s\S]*required\s+double\s+value\s*\{/i);
|
|
494
|
-
expect(csharp).to.match(/read\s*\(\s*Payload__Alias\s+input\s*\)/i);
|
|
495
|
-
expect(csharp).not.to.match(/class\s+Payload__Alias[\s\S]*required\s+string\s+value\s*\{/i);
|
|
496
|
-
});
|
|
497
|
-
it("keeps compile outputs independent when same alias name is reused", () => {
|
|
498
|
-
const sourceA = `
|
|
499
|
-
export type UserId = string;
|
|
500
|
-
export interface User {
|
|
501
|
-
id: UserId;
|
|
502
|
-
}
|
|
503
|
-
`;
|
|
504
|
-
const sourceB = `
|
|
505
|
-
export type UserId = number;
|
|
506
|
-
export interface User {
|
|
507
|
-
id: UserId;
|
|
508
|
-
}
|
|
509
|
-
`;
|
|
510
|
-
const csharpA = compileToCSharp(sourceA);
|
|
511
|
-
const csharpB = compileToCSharp(sourceB);
|
|
512
|
-
const csharpAAgain = compileToCSharp(sourceA);
|
|
513
|
-
expect(csharpA).to.match(/required\s+string\s+id\s*\{/i);
|
|
514
|
-
expect(csharpB).to.match(/required\s+double\s+id\s*\{/i);
|
|
515
|
-
expect(csharpAAgain).to.match(/required\s+string\s+id\s*\{/i);
|
|
516
|
-
expect(csharpAAgain).not.to.match(/required\s+double\s+id\s*\{/i);
|
|
517
|
-
});
|
|
518
|
-
});
|
|
519
|
-
describe("Promise Chains", () => {
|
|
520
|
-
it("lowers Promise.then to Task.Run async wrapper", () => {
|
|
521
|
-
const source = `
|
|
522
|
-
declare class Promise<T> {
|
|
523
|
-
then<U>(onFulfilled: (value: T) => U | PromiseLike<U>): Promise<U>;
|
|
524
|
-
catch<U>(onRejected: (reason: unknown) => U | PromiseLike<U>): Promise<T | U>;
|
|
525
|
-
finally(onFinally: () => void): Promise<T>;
|
|
526
|
-
static resolve<T>(value: T): Promise<T>;
|
|
527
|
-
}
|
|
528
|
-
interface PromiseLike<T> {}
|
|
529
|
-
|
|
530
|
-
export async function load(): Promise<number> {
|
|
531
|
-
return 1;
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
export async function run(): Promise<number> {
|
|
535
|
-
const p = load();
|
|
536
|
-
return p.then((x) => x + 1);
|
|
537
|
-
}
|
|
538
|
-
`;
|
|
539
|
-
const csharp = compileToCSharp(source);
|
|
540
|
-
expect(csharp).to.include("Task.Run<double>(async");
|
|
541
|
-
expect(csharp).to.include("await p");
|
|
542
|
-
});
|
|
543
|
-
it("normalizes Promise.then callback PromiseLike return to inner result type", () => {
|
|
544
|
-
const source = `
|
|
545
|
-
declare class Promise<T> {
|
|
546
|
-
then<U>(onFulfilled: (value: T) => U | PromiseLike<U>): Promise<U>;
|
|
547
|
-
static resolve<T>(value: T): Promise<T>;
|
|
548
|
-
}
|
|
549
|
-
interface PromiseLike<T> {}
|
|
550
|
-
|
|
551
|
-
export async function load(): Promise<number> {
|
|
552
|
-
return 1;
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
export async function run(): Promise<number> {
|
|
556
|
-
const p = load();
|
|
557
|
-
return p.then((x) => Promise.resolve(x + 1));
|
|
558
|
-
}
|
|
559
|
-
`;
|
|
560
|
-
const csharp = compileToCSharp(source);
|
|
561
|
-
expect(csharp).to.include("Task.Run<double>(async");
|
|
562
|
-
expect(csharp).not.to.include("Task.Run<global::Tsonic.Runtime.Union");
|
|
563
|
-
});
|
|
564
|
-
it("preserves int result when Promise.then callback stays in int space", () => {
|
|
565
|
-
const source = `
|
|
566
|
-
import { int } from "@tsonic/core/types.js";
|
|
567
|
-
|
|
568
|
-
declare class Promise<T> {
|
|
569
|
-
then<U>(onFulfilled: (value: T) => U | PromiseLike<U>): Promise<U>;
|
|
570
|
-
}
|
|
571
|
-
interface PromiseLike<T> {}
|
|
572
|
-
|
|
573
|
-
export async function load(): Promise<int> {
|
|
574
|
-
return 1;
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
export async function run(): Promise<int> {
|
|
578
|
-
const p = load();
|
|
579
|
-
return p.then((x) => x + 1);
|
|
580
|
-
}
|
|
581
|
-
`;
|
|
582
|
-
const csharp = compileToCSharp(source);
|
|
583
|
-
expect(csharp).to.include("Task.Run<int>(async");
|
|
584
|
-
expect(csharp).not.to.include("Task.Run<double>(async");
|
|
585
|
-
});
|
|
586
|
-
it("lowers Promise.catch to Task.Run with try/catch", () => {
|
|
587
|
-
const source = `
|
|
588
|
-
declare class Promise<T> {
|
|
589
|
-
then<U>(onFulfilled: (value: T) => U | PromiseLike<U>): Promise<U>;
|
|
590
|
-
catch<U>(onRejected: (reason: unknown) => U | PromiseLike<U>): Promise<T | U>;
|
|
591
|
-
finally(onFinally: () => void): Promise<T>;
|
|
592
|
-
static resolve<T>(value: T): Promise<T>;
|
|
593
|
-
}
|
|
594
|
-
interface PromiseLike<T> {}
|
|
595
|
-
|
|
596
|
-
export async function load(): Promise<number> {
|
|
597
|
-
return 1;
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
export async function run(): Promise<number> {
|
|
601
|
-
const p = load();
|
|
602
|
-
return p.catch((_e) => 0);
|
|
603
|
-
}
|
|
604
|
-
`;
|
|
605
|
-
const csharp = compileToCSharp(source);
|
|
606
|
-
expect(csharp).to.include("Task.Run");
|
|
607
|
-
expect(csharp).to.include("catch (global::System.Exception __tsonic_promise_ex)");
|
|
608
|
-
});
|
|
609
|
-
it("lowers Promise.finally to Task.Run with finally", () => {
|
|
610
|
-
const source = `
|
|
611
|
-
declare class Promise<T> {
|
|
612
|
-
then<U>(onFulfilled: (value: T) => U | PromiseLike<U>): Promise<U>;
|
|
613
|
-
catch<U>(onRejected: (reason: unknown) => U | PromiseLike<U>): Promise<T | U>;
|
|
614
|
-
finally(onFinally: () => void): Promise<T>;
|
|
615
|
-
static resolve<T>(value: T): Promise<T>;
|
|
616
|
-
}
|
|
617
|
-
interface PromiseLike<T> {}
|
|
618
|
-
|
|
619
|
-
export async function load(): Promise<number> {
|
|
620
|
-
return 1;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
export async function run(): Promise<number> {
|
|
624
|
-
const p = load();
|
|
625
|
-
return p.finally(() => {});
|
|
626
|
-
}
|
|
627
|
-
`;
|
|
628
|
-
const csharp = compileToCSharp(source);
|
|
629
|
-
expect(csharp).to.include("Task.Run<double>(async");
|
|
630
|
-
expect(csharp).to.include("finally");
|
|
631
|
-
});
|
|
632
|
-
it("keeps Promise chains on the frontend-normalized result type", () => {
|
|
633
|
-
const source = `
|
|
634
|
-
import type { int } from "@tsonic/core/types.js";
|
|
635
|
-
|
|
636
|
-
declare class Promise<T> {
|
|
637
|
-
then<U>(onFulfilled: (value: T) => U | PromiseLike<U>): Promise<U>;
|
|
638
|
-
catch<U>(onRejected: (reason: unknown) => U | PromiseLike<U>): Promise<T | U>;
|
|
639
|
-
finally(onFinally: () => void): Promise<T>;
|
|
640
|
-
}
|
|
641
|
-
interface PromiseLike<T> {}
|
|
642
|
-
|
|
643
|
-
export function chainScore(seed: Promise<int>): Promise<int> {
|
|
644
|
-
return seed
|
|
645
|
-
.then((value) => value + 1)
|
|
646
|
-
.catch((_error) => 0)
|
|
647
|
-
.finally(() => {});
|
|
648
|
-
}
|
|
649
|
-
`;
|
|
650
|
-
const csharp = compileToCSharp(source);
|
|
651
|
-
expect(csharp).to.include("Task.Run<int>(async");
|
|
652
|
-
expect(csharp).not.to.include("Task.Run<global::Tsonic.Runtime.Union");
|
|
653
|
-
});
|
|
654
|
-
it("lets Promise.catch delegate casts supply exception parameter types", () => {
|
|
655
|
-
const source = `
|
|
656
|
-
import type { int } from "@tsonic/core/types.js";
|
|
657
|
-
|
|
658
|
-
declare class Promise<T> {
|
|
659
|
-
catch<TResult>(
|
|
660
|
-
onrejected: ((reason: unknown) => TResult | PromiseLike<TResult>) | undefined | null
|
|
661
|
-
): Promise<T | TResult>;
|
|
662
|
-
}
|
|
663
|
-
interface PromiseLike<T> {}
|
|
664
|
-
|
|
665
|
-
export function recover(seed: Promise<int>): Promise<int> {
|
|
666
|
-
return seed.catch((_error) => 0);
|
|
667
|
-
}
|
|
668
|
-
`;
|
|
669
|
-
const csharp = compileToCSharp(source);
|
|
670
|
-
expect(csharp).to.include("Func<global::System.Exception, int>");
|
|
671
|
-
expect(csharp).not.to.include("(object _error) => 0");
|
|
672
|
-
});
|
|
673
|
-
it("uses Action for block-bodied void callbacks in Promise chains", () => {
|
|
674
|
-
const source = `
|
|
675
|
-
declare class Promise<T> {
|
|
676
|
-
then<U>(onFulfilled: (value: T) => U | PromiseLike<U>): Promise<U>;
|
|
677
|
-
}
|
|
678
|
-
interface PromiseLike<T> {}
|
|
679
|
-
|
|
680
|
-
export function chain(seed: Promise<number>): Promise<void> {
|
|
681
|
-
return seed.then(() => {});
|
|
682
|
-
}
|
|
683
|
-
`;
|
|
684
|
-
const csharp = compileToCSharp(source);
|
|
685
|
-
expect(csharp).to.include("global::System.Action");
|
|
686
|
-
expect(csharp).not.to.include("global::System.Func<global::Tsonic.Runtime.Union<void");
|
|
687
|
-
});
|
|
688
|
-
});
|
|
689
|
-
describe("Promise Static Methods", () => {
|
|
690
|
-
it("lowers Promise.all to Task.WhenAll over normalized task inputs", () => {
|
|
691
|
-
const source = `
|
|
692
|
-
interface PromiseLike<T> {
|
|
693
|
-
then<TResult1 = T, TResult2 = never>(
|
|
694
|
-
onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null,
|
|
695
|
-
onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | undefined | null
|
|
696
|
-
): PromiseLike<TResult1 | TResult2>;
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
declare class Promise<T> {
|
|
700
|
-
static all<T>(values: readonly (T | PromiseLike<T>)[]): Promise<T[]>;
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
async function runWorker(name: string): Promise<number> {
|
|
704
|
-
return 1;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
export async function main(): Promise<void> {
|
|
708
|
-
const results = await Promise.all([
|
|
709
|
-
runWorker("a"),
|
|
710
|
-
runWorker("b"),
|
|
711
|
-
runWorker("c"),
|
|
712
|
-
]);
|
|
713
|
-
void results;
|
|
714
|
-
}
|
|
715
|
-
`;
|
|
716
|
-
const csharp = compileToCSharp(source);
|
|
717
|
-
expect(csharp).to.include("Task.WhenAll");
|
|
718
|
-
expect(csharp).to.include("Enumerable.Select");
|
|
719
|
-
expect(csharp).not.to.include("Promise.all(");
|
|
720
|
-
});
|
|
721
|
-
it("lowers Promise.resolve to Task.FromResult", () => {
|
|
722
|
-
const source = `
|
|
723
|
-
declare class PromiseLike<T> {}
|
|
724
|
-
declare class Promise<T> {
|
|
725
|
-
static resolve<T>(value: T | PromiseLike<T>): Promise<T>;
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
export function main(): Promise<number> {
|
|
729
|
-
const value: number = 1;
|
|
730
|
-
return Promise.resolve(value);
|
|
731
|
-
}
|
|
732
|
-
`;
|
|
733
|
-
const csharp = compileToCSharp(source);
|
|
734
|
-
expect(csharp).to.include("Task.FromResult<double>");
|
|
735
|
-
expect(csharp).not.to.include("Promise.resolve(");
|
|
736
|
-
});
|
|
737
|
-
it("lowers Promise.reject to Task.FromException", () => {
|
|
738
|
-
const source = `
|
|
739
|
-
declare class Promise<T> {
|
|
740
|
-
static reject<T = never>(reason?: any): Promise<T>;
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
export function main(): Promise<number> {
|
|
744
|
-
return Promise.reject<number>("boom");
|
|
745
|
-
}
|
|
746
|
-
`;
|
|
747
|
-
const csharp = compileToCSharp(source);
|
|
748
|
-
expect(csharp).to.include("Task.FromException<double>");
|
|
749
|
-
expect(csharp).to.include('"Promise rejected"');
|
|
750
|
-
expect(csharp).not.to.include("Promise.reject(");
|
|
751
|
-
});
|
|
752
|
-
});
|
|
753
|
-
describe("Await Lowering", () => {
|
|
754
|
-
it("awaits non-generic Task values directly", () => {
|
|
755
|
-
const source = `
|
|
756
|
-
import type { Task } from "@tsonic/dotnet/System.Threading.Tasks.js";
|
|
757
|
-
import { Task as TaskValue } from "@tsonic/dotnet/System.Threading.Tasks.js";
|
|
758
|
-
|
|
759
|
-
function flush(): Task {
|
|
760
|
-
return TaskValue.CompletedTask;
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
export async function run(): Promise<void> {
|
|
764
|
-
await flush();
|
|
765
|
-
}
|
|
766
|
-
`;
|
|
767
|
-
const csharp = compileToCSharp(source);
|
|
768
|
-
expect(csharp).to.include("await flush();");
|
|
769
|
-
expect(csharp).not.to.include("Task.FromResult");
|
|
770
|
-
});
|
|
771
|
-
it("awaits non-generic ValueTask values directly", () => {
|
|
772
|
-
const source = `
|
|
773
|
-
import type { ValueTask } from "@tsonic/dotnet/System.Threading.Tasks.js";
|
|
774
|
-
import { ValueTask as ValueTaskValue } from "@tsonic/dotnet/System.Threading.Tasks.js";
|
|
775
|
-
|
|
776
|
-
function flush(): ValueTask {
|
|
777
|
-
return ValueTaskValue.CompletedTask;
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
export async function run(): Promise<void> {
|
|
781
|
-
await flush();
|
|
782
|
-
}
|
|
783
|
-
`;
|
|
784
|
-
const csharp = compileToCSharp(source);
|
|
785
|
-
expect(csharp).to.include("await flush();");
|
|
786
|
-
expect(csharp).not.to.include("Task.FromResult");
|
|
787
|
-
});
|
|
788
|
-
});
|
|
789
|
-
describe("Core Intrinsics", () => {
|
|
790
|
-
it("lowers nameof to a compile-time string literal using TS-authored names", () => {
|
|
791
|
-
const source = `
|
|
792
|
-
import { nameof } from "@tsonic/core/lang.js";
|
|
793
|
-
|
|
794
|
-
interface User {
|
|
795
|
-
name: string;
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
export function getName(user: User): string {
|
|
799
|
-
return nameof(user.name);
|
|
800
|
-
}
|
|
801
|
-
`;
|
|
802
|
-
const csharp = compileToCSharp(source);
|
|
803
|
-
expect(csharp).to.include('return "name";');
|
|
804
|
-
});
|
|
805
|
-
it("lowers sizeof to C# sizeof(T)", () => {
|
|
806
|
-
const source = `
|
|
807
|
-
import type { int } from "@tsonic/core/types.js";
|
|
808
|
-
import { sizeof } from "@tsonic/core/lang.js";
|
|
809
|
-
|
|
810
|
-
export function getIntSize(): int {
|
|
811
|
-
return sizeof<int>();
|
|
812
|
-
}
|
|
813
|
-
`;
|
|
814
|
-
const csharp = compileToCSharp(source);
|
|
815
|
-
expect(csharp).to.include("return sizeof(int);");
|
|
816
|
-
});
|
|
817
|
-
});
|
|
818
|
-
describe("Local Function Values", () => {
|
|
819
|
-
it("lowers recursive local arrow functions through explicit delegate initialization", () => {
|
|
820
|
-
const source = `
|
|
821
|
-
type Node = {
|
|
822
|
-
name: string;
|
|
823
|
-
children: Node[];
|
|
824
|
-
};
|
|
825
|
-
|
|
826
|
-
export function flatten(nodes: Node[]): string[] {
|
|
827
|
-
const names: string[] = [];
|
|
828
|
-
const walk = (current: Node[]): void => {
|
|
829
|
-
for (let i = 0; i < current.length; i++) {
|
|
830
|
-
const node = current[i]!;
|
|
831
|
-
names.push(node.name);
|
|
832
|
-
walk(node.children);
|
|
833
|
-
}
|
|
834
|
-
};
|
|
835
|
-
|
|
836
|
-
walk(nodes);
|
|
837
|
-
return names;
|
|
838
|
-
}
|
|
839
|
-
`;
|
|
840
|
-
const csharp = compileToCSharp(source);
|
|
841
|
-
expect(csharp).to.include("global::System.Action<Node__Alias[]> walk = default");
|
|
842
|
-
expect(csharp).to.match(/walk\s*=\s*\(Node__Alias\[\]\s+current\)\s*=>/);
|
|
843
|
-
expect(csharp).not.to.include("var walk =");
|
|
844
|
-
});
|
|
845
|
-
});
|
|
846
|
-
describe("Regression Coverage", () => {
|
|
847
|
-
it("passes contextual string expectations through array element assignments", () => {
|
|
848
|
-
const source = `
|
|
849
|
-
export function main(): string[] {
|
|
850
|
-
const chars: string[] = ["", ""];
|
|
851
|
-
const source = "ab";
|
|
852
|
-
chars[0] = source[0];
|
|
853
|
-
return chars;
|
|
854
|
-
}
|
|
855
|
-
`;
|
|
856
|
-
const csharp = compileToCSharp(source);
|
|
857
|
-
expect(csharp).to.include('string[] chars = new string[] { "", "" };');
|
|
858
|
-
expect(csharp).to.include("chars[0] = source[0].ToString();");
|
|
859
|
-
});
|
|
860
|
-
it("default-initializes explicit locals without initializers", () => {
|
|
861
|
-
const source = `
|
|
862
|
-
export function pick(flag: boolean): string {
|
|
863
|
-
let name: string;
|
|
864
|
-
if (flag) {
|
|
865
|
-
name = "ok";
|
|
866
|
-
} else {
|
|
867
|
-
name = "no";
|
|
868
|
-
}
|
|
869
|
-
return name;
|
|
870
|
-
}
|
|
871
|
-
`;
|
|
872
|
-
const csharp = compileToCSharp(source);
|
|
873
|
-
expect(csharp).to.include("string name = default(string);");
|
|
874
|
-
});
|
|
875
|
-
it("prefers typed CLR option overloads over erased unknown for object literals", () => {
|
|
876
|
-
const source = `
|
|
877
|
-
declare class MkdirOptions {
|
|
878
|
-
readonly __tsonic_type_nodejs_MkdirOptions: never;
|
|
879
|
-
recursive?: boolean;
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
declare const fs: {
|
|
883
|
-
mkdirSync(path: string, options: MkdirOptions): void;
|
|
884
|
-
mkdirSync(path: string, recursive?: boolean): void;
|
|
885
|
-
mkdirSync(path: string, options: unknown): void;
|
|
886
|
-
};
|
|
887
|
-
|
|
888
|
-
export function ensure(dir: string): void {
|
|
889
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
890
|
-
}
|
|
891
|
-
`;
|
|
892
|
-
const csharp = compileToCSharp(source);
|
|
893
|
-
expect(csharp).to.include("fs.mkdirSync(dir, new global::Test.MkdirOptions");
|
|
894
|
-
expect(csharp).not.to.include("Dictionary<string, object?>");
|
|
895
|
-
});
|
|
896
|
-
it("emits indexer access for alias-wrapped string dictionaries", () => {
|
|
897
|
-
const source = `
|
|
898
|
-
interface SettingsMap {
|
|
899
|
-
[key: string]: string;
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
declare function load(): SettingsMap;
|
|
903
|
-
|
|
904
|
-
export function readSetting(): string | undefined {
|
|
905
|
-
const settings = load();
|
|
906
|
-
return settings["waiting_period_threshold"];
|
|
907
|
-
}
|
|
908
|
-
`;
|
|
909
|
-
const csharp = compileToCSharp(source);
|
|
910
|
-
expect(csharp).to.include('return settings["waiting_period_threshold"];');
|
|
911
|
-
expect(csharp).not.to.include("settings.waiting_period_threshold");
|
|
912
|
-
});
|
|
913
|
-
it("emits indexer access for generic-return dictionary aliases after null narrowing", () => {
|
|
914
|
-
const source = `
|
|
915
|
-
type SettingsMap = { [key: string]: string };
|
|
916
|
-
|
|
917
|
-
declare const JsonSerializer: {
|
|
918
|
-
Deserialize<T>(json: string): T | undefined;
|
|
919
|
-
};
|
|
920
|
-
|
|
921
|
-
export function readSetting(json: string): string | undefined {
|
|
922
|
-
const settingsOrNull = JsonSerializer.Deserialize<SettingsMap>(json);
|
|
923
|
-
if (settingsOrNull === undefined) {
|
|
924
|
-
return undefined;
|
|
925
|
-
}
|
|
926
|
-
const settings = settingsOrNull;
|
|
927
|
-
return settings["waiting_period_threshold"];
|
|
928
|
-
}
|
|
929
|
-
`;
|
|
930
|
-
const csharp = compileToCSharp(source);
|
|
931
|
-
expect(csharp).to.include('return settings["waiting_period_threshold"];');
|
|
932
|
-
expect(csharp).not.to.include("settings.waiting_period_threshold");
|
|
933
|
-
});
|
|
934
|
-
it("emits object literals with exact numeric properties after nullish fallback narrowing", () => {
|
|
935
|
-
const source = `
|
|
936
|
-
import type { int } from "@tsonic/core/types.js";
|
|
937
|
-
|
|
938
|
-
declare function parseRole(raw: string): int | undefined;
|
|
939
|
-
|
|
940
|
-
export function run(raw: string): int {
|
|
941
|
-
const parsedInviteAsRole = parseRole(raw);
|
|
942
|
-
const inviteAsRole = parsedInviteAsRole ?? (400 as int);
|
|
943
|
-
const input = {
|
|
944
|
-
inviteAsRole,
|
|
945
|
-
};
|
|
946
|
-
return input.inviteAsRole;
|
|
947
|
-
}
|
|
948
|
-
`;
|
|
949
|
-
const csharp = compileToCSharp(source);
|
|
950
|
-
expect(csharp).to.include("inviteAsRole = inviteAsRole");
|
|
951
|
-
expect(csharp).not.to.include("Object literal cannot be synthesized");
|
|
952
|
-
});
|
|
953
|
-
it("preserves optional value-type properties in object literals", () => {
|
|
954
|
-
const source = `
|
|
955
|
-
import type { int } from "@tsonic/core/types.js";
|
|
956
|
-
|
|
957
|
-
declare function parseLimit(raw: string, fallback: int): int;
|
|
958
|
-
|
|
959
|
-
type Options = {
|
|
960
|
-
limit?: int;
|
|
961
|
-
};
|
|
962
|
-
|
|
963
|
-
export function run(limitRaw: string | undefined): int {
|
|
964
|
-
const limit = limitRaw ? parseLimit(limitRaw, 100 as int) : undefined;
|
|
965
|
-
const options: Options = { limit };
|
|
966
|
-
return options.limit ?? (0 as int);
|
|
967
|
-
}
|
|
968
|
-
`;
|
|
969
|
-
const csharp = compileToCSharp(source);
|
|
970
|
-
expect(csharp).to.include("limit = limit");
|
|
971
|
-
expect(csharp).not.to.include("limit = limit.Value");
|
|
972
|
-
expect(csharp).to.include("int? limit =");
|
|
973
|
-
expect(csharp).not.to.include("var limit =");
|
|
974
|
-
});
|
|
975
|
-
it("lowers typed object spreads into object-root dictionary results", () => {
|
|
976
|
-
const source = `
|
|
977
|
-
type ApiKeyData = {
|
|
978
|
-
apiKey: string;
|
|
979
|
-
userId: string;
|
|
980
|
-
};
|
|
981
|
-
|
|
982
|
-
export function buildResponse(data: ApiKeyData): object {
|
|
983
|
-
return { result: "success", msg: "", ...data };
|
|
984
|
-
}
|
|
985
|
-
`;
|
|
986
|
-
const csharp = compileToCSharp(source);
|
|
987
|
-
expect(csharp).to.include("global::System.Collections.Generic.Dictionary<string, object?>");
|
|
988
|
-
expect(csharp).to.include('__tmp["result"] = "success"');
|
|
989
|
-
expect(csharp).to.include('__tmp["msg"] = ""');
|
|
990
|
-
expect(csharp).to.include('__tmp["apiKey"] = __spread.apiKey');
|
|
991
|
-
expect(csharp).to.include('__tmp["userId"] = __spread.userId');
|
|
992
|
-
});
|
|
993
|
-
it("lowers dictionary spreads into object-root dictionary results", () => {
|
|
994
|
-
const source = `
|
|
995
|
-
type StringMap = {
|
|
996
|
-
[key: string]: string;
|
|
997
|
-
};
|
|
998
|
-
|
|
999
|
-
export function buildResponse(data: StringMap): object {
|
|
1000
|
-
return { result: "success", ...data, msg: "" };
|
|
1001
|
-
}
|
|
1002
|
-
`;
|
|
1003
|
-
const csharp = compileToCSharp(source);
|
|
1004
|
-
expect(csharp).to.include("foreach (var __entry in __spread)");
|
|
1005
|
-
expect(csharp).to.include("__tmp[__entry.Key] = __entry.Value;");
|
|
1006
|
-
expect(csharp).to.include('__tmp["result"] = "success";');
|
|
1007
|
-
expect(csharp).to.include('__tmp["msg"] = "";');
|
|
1008
|
-
});
|
|
1009
|
-
it("uses element access for index-signature property reads and writes", () => {
|
|
1010
|
-
const source = `
|
|
1011
|
-
export function buildState(): Record<string, unknown> {
|
|
1012
|
-
const state: Record<string, unknown> = {};
|
|
1013
|
-
state.user_id = "u1";
|
|
1014
|
-
state.email = "u@example.com";
|
|
1015
|
-
const bot = state.user_id;
|
|
1016
|
-
state.is_bot = bot === "u1";
|
|
1017
|
-
return state;
|
|
1018
|
-
}
|
|
1019
|
-
`;
|
|
1020
|
-
const csharp = compileToCSharp(source);
|
|
1021
|
-
expect(csharp).to.include('state["user_id"] = "u1";');
|
|
1022
|
-
expect(csharp).to.include('state["email"] = "u@example.com";');
|
|
1023
|
-
expect(csharp).to.include('var bot = state["user_id"];');
|
|
1024
|
-
expect(csharp).to.include('state["is_bot"] = bot == "u1";');
|
|
1025
|
-
expect(csharp).not.to.include("state.user_id");
|
|
1026
|
-
expect(csharp).not.to.include("state.email");
|
|
1027
|
-
expect(csharp).not.to.include("state.is_bot");
|
|
1028
|
-
});
|
|
1029
|
-
it("materializes structural object arguments using the callee interface type", () => {
|
|
1030
|
-
const source = `
|
|
1031
|
-
import type { int } from "@tsonic/core/types.js";
|
|
1032
|
-
|
|
1033
|
-
interface CreateParams {
|
|
1034
|
-
isPrivate?: int;
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
declare function subscribe(params?: CreateParams): void;
|
|
1038
|
-
|
|
1039
|
-
export function run(inviteOnly: int | undefined): void {
|
|
1040
|
-
const createParams: { isPrivate?: int } = { isPrivate: inviteOnly };
|
|
1041
|
-
subscribe(createParams);
|
|
1042
|
-
}
|
|
1043
|
-
`;
|
|
1044
|
-
const csharp = compileToCSharp(source);
|
|
1045
|
-
expect(csharp).to.include("subscribe(new CreateParams { isPrivate = createParams.isPrivate });");
|
|
1046
|
-
expect(csharp).not.to.include("subscribe(createParams);");
|
|
1047
|
-
});
|
|
1048
|
-
it("uses runtime equality for unknown-vs-boolean strict comparisons", () => {
|
|
1049
|
-
const source = `
|
|
1050
|
-
export function hasSubdomain(body: Record<string, unknown>): boolean {
|
|
1051
|
-
return body.allow_subdomains === true;
|
|
1052
|
-
}
|
|
1053
|
-
`;
|
|
1054
|
-
const csharp = compileToCSharp(source);
|
|
1055
|
-
expect(csharp).to.include('global::System.Object.Equals(body["allow_subdomains"], true)');
|
|
1056
|
-
expect(csharp).not.to.include('body["allow_subdomains"] == true');
|
|
1057
|
-
});
|
|
1058
|
-
it("materializes structural object arguments for inline object-type parameters", () => {
|
|
1059
|
-
const source = `
|
|
1060
|
-
import type { int } from "@tsonic/core/types.js";
|
|
1061
|
-
|
|
1062
|
-
type CreateInput = { fullName: string; shortName: string; botType?: int };
|
|
1063
|
-
|
|
1064
|
-
declare function createBotDomain(input: { fullName: string; shortName: string; botType?: int }): void;
|
|
1065
|
-
|
|
1066
|
-
export function run(botType: int | undefined): void {
|
|
1067
|
-
const input: CreateInput = { fullName: "Bot", shortName: "bot", botType };
|
|
1068
|
-
createBotDomain(input);
|
|
1069
|
-
}
|
|
1070
|
-
`;
|
|
1071
|
-
const csharp = compileToCSharp(source);
|
|
1072
|
-
expect(csharp).to.match(/createBotDomain\(new .* \{ fullName = input\.fullName, shortName = input\.shortName, botType = input\.botType \}\);/);
|
|
1073
|
-
expect(csharp).not.to.include("createBotDomain(input);");
|
|
1074
|
-
});
|
|
1075
|
-
it("materializes structural arrays for inline object-type element parameters", () => {
|
|
1076
|
-
const source = `
|
|
1077
|
-
type AddItem = { name: string; description?: string };
|
|
1078
|
-
|
|
1079
|
-
declare function bulkUpdate(add?: { name: string; description?: string }[]): void;
|
|
1080
|
-
|
|
1081
|
-
export function run(addRaw: string | undefined): void {
|
|
1082
|
-
const addList = addRaw ? JSON.parse(addRaw) as AddItem[] : undefined;
|
|
1083
|
-
bulkUpdate(addList);
|
|
1084
|
-
}
|
|
1085
|
-
`;
|
|
1086
|
-
const csharp = compileToCSharp(source);
|
|
1087
|
-
expect(csharp).to.include("global::System.Linq.Enumerable.ToArray");
|
|
1088
|
-
expect(csharp).to.include("name =");
|
|
1089
|
-
expect(csharp).to.include("description =");
|
|
1090
|
-
expect(csharp).not.to.include("bulkUpdate(addList);");
|
|
1091
|
-
});
|
|
1092
|
-
it("materializes structural dictionary values for inline object-type parameters", () => {
|
|
1093
|
-
const source = `
|
|
1094
|
-
type ProfileEntry = { value: string };
|
|
1095
|
-
|
|
1096
|
-
declare function updateProfileData(profileData: Record<string, { value: string }>): void;
|
|
1097
|
-
|
|
1098
|
-
export function run(profileData: Record<string, ProfileEntry>): void {
|
|
1099
|
-
updateProfileData(profileData);
|
|
1100
|
-
}
|
|
1101
|
-
`;
|
|
1102
|
-
const csharp = compileToCSharp(source);
|
|
1103
|
-
expect(csharp).to.include("new global::System.Collections.Generic.Dictionary");
|
|
1104
|
-
expect(csharp).to.include("value =");
|
|
1105
|
-
expect(csharp).not.to.include("updateProfileData(profileData);");
|
|
1106
|
-
});
|
|
1107
|
-
it("materializes imported structural alias locals without re-emitting anonymous object types", () => {
|
|
1108
|
-
const csharp = compileToCSharp(`
|
|
1109
|
-
type AppContext = {
|
|
1110
|
-
readonly options: string;
|
|
1111
|
-
readonly config: string;
|
|
1112
|
-
};
|
|
1113
|
-
|
|
1114
|
-
export function run(): void {
|
|
1115
|
-
const options = "cs";
|
|
1116
|
-
const config = "http://localhost:3000";
|
|
1117
|
-
const ctx: AppContext = { options, config };
|
|
1118
|
-
void ctx;
|
|
1119
|
-
}
|
|
1120
|
-
`);
|
|
1121
|
-
expect(csharp).to.include("class AppContext__Alias");
|
|
1122
|
-
expect(csharp).to.match(/AppContext__Alias\s+ctx\s*=\s*new\s+AppContext__Alias\s*\{\s*options\s*=\s*options,\s*config\s*=\s*config\s*\}/);
|
|
1123
|
-
expect(csharp).not.to.include("ICE: Anonymous object type reached emitter");
|
|
1124
|
-
});
|
|
1125
|
-
it("materializes inline object-type elements through generic List<T>.Add", () => {
|
|
1126
|
-
const source = `
|
|
1127
|
-
declare class List<T> {
|
|
1128
|
-
Add(item: T): void;
|
|
1129
|
-
ToArray(): T[];
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
declare function createDraftsDomain(inputs: { type: string; to: string; topic?: string; content: string }[]): void;
|
|
1133
|
-
|
|
1134
|
-
export function run(): void {
|
|
1135
|
-
const inputs = new List<{ type: string; to: string; topic?: string; content: string }>();
|
|
1136
|
-
inputs.Add({ type: "stream", to: "general", topic: "t", content: "hi" });
|
|
1137
|
-
createDraftsDomain(inputs.ToArray());
|
|
1138
|
-
}
|
|
1139
|
-
`;
|
|
1140
|
-
const csharp = compileToCSharp(source);
|
|
1141
|
-
expect(csharp).to.match(/inputs\.Add\(new .* \{ type = "stream", to = "general", topic = "t", content = "hi" \}\);/);
|
|
1142
|
-
expect(csharp).not.to.include("inputs.Add(new global::System.Collections.Generic.Dictionary");
|
|
1143
|
-
});
|
|
1144
|
-
it("materializes inline object-type arrays through generic List<T>.ToArray()", () => {
|
|
1145
|
-
const source = `
|
|
1146
|
-
declare class List<T> {
|
|
1147
|
-
Add(item: T): void;
|
|
1148
|
-
ToArray(): T[];
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
declare function createDraftsDomain(inputs: { type: string; to: string; topic?: string; content: string }[]): void;
|
|
1152
|
-
|
|
1153
|
-
export function run(drafts: { type: string; to: string; topic?: string; content: string }[]): void {
|
|
1154
|
-
const inputs = new List<{ type: string; to: string; topic?: string; content: string }>();
|
|
1155
|
-
for (let i = 0; i < drafts.length; i++) {
|
|
1156
|
-
const d = drafts[i];
|
|
1157
|
-
inputs.Add({ type: d.type, to: d.to, topic: d.topic, content: d.content });
|
|
1158
|
-
}
|
|
1159
|
-
createDraftsDomain(inputs.ToArray());
|
|
1160
|
-
}
|
|
1161
|
-
`;
|
|
1162
|
-
const csharp = compileToCSharp(source);
|
|
1163
|
-
expect(csharp).to.match(/inputs\.Add\(new .* \{ type = d\.type, to = d\.to, topic = d\.topic, content = d\.content \}\);/);
|
|
1164
|
-
expect(csharp).to.include("createDraftsDomain(inputs.ToArray());");
|
|
1165
|
-
});
|
|
1166
|
-
it("emits empty inline object-type locals with optional properties", () => {
|
|
1167
|
-
const source = `
|
|
1168
|
-
import type { int } from "@tsonic/core/types.js";
|
|
1169
|
-
|
|
1170
|
-
export function run(name: string | undefined, active: int | undefined): void {
|
|
1171
|
-
const updates: { name?: string; active?: int } = {};
|
|
1172
|
-
if (name) updates.name = name;
|
|
1173
|
-
if (active !== undefined) updates.active = active;
|
|
1174
|
-
void updates;
|
|
1175
|
-
}
|
|
1176
|
-
`;
|
|
1177
|
-
const csharp = compileToCSharp(source);
|
|
1178
|
-
expect(csharp).to.match(/__Anon_[A-Za-z0-9_]+\s+updates\s*=\s*new\s+global::Test\.__Anon_[A-Za-z0-9_]+\(\);/);
|
|
1179
|
-
expect(csharp).not.to.include("new global::System.Collections.Generic.Dictionary");
|
|
1180
|
-
});
|
|
1181
|
-
});
|
|
1182
|
-
describe("Object Literal Methods", () => {
|
|
1183
|
-
it("rewrites supported arguments.length usage to a fixed arity literal", () => {
|
|
1184
|
-
const source = `
|
|
1185
|
-
interface Ops {
|
|
1186
|
-
add: (x: number, y: number) => number;
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
|
-
export function run(): number {
|
|
1190
|
-
const ops: Ops = {
|
|
1191
|
-
add(x: number, y: number): number {
|
|
1192
|
-
return arguments.length + x + y;
|
|
1193
|
-
},
|
|
1194
|
-
};
|
|
1195
|
-
return ops.add(1, 2);
|
|
1196
|
-
}
|
|
1197
|
-
`;
|
|
1198
|
-
const csharp = compileToCSharp(source);
|
|
1199
|
-
expect(csharp).to.include("return 2 + x + y;");
|
|
1200
|
-
expect(csharp).not.to.include("arguments");
|
|
1201
|
-
});
|
|
1202
|
-
it("rewrites supported arguments[n] usage to captured parameter temps", () => {
|
|
1203
|
-
const source = `
|
|
1204
|
-
interface Ops {
|
|
1205
|
-
add: (x: number, y: number) => number;
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
export function run(): number {
|
|
1209
|
-
const ops: Ops = {
|
|
1210
|
-
add(x: number, y: number): number {
|
|
1211
|
-
return (arguments[0] as number) + y;
|
|
1212
|
-
},
|
|
1213
|
-
};
|
|
1214
|
-
return ops.add(1, 2);
|
|
1215
|
-
}
|
|
1216
|
-
`;
|
|
1217
|
-
const csharp = compileToCSharp(source);
|
|
1218
|
-
expect(csharp).to.include("var __tsonic_object_method_argument_0 = x;");
|
|
1219
|
-
expect(csharp).to.include("return (double)__tsonic_object_method_argument_0 + y;");
|
|
1220
|
-
expect(csharp).not.to.include("arguments");
|
|
1221
|
-
});
|
|
1222
|
-
});
|
|
1223
|
-
});
|
|
1
|
+
import "./integration-cases/arrow-and-generics-a.test.js";
|
|
2
|
+
import "./integration-cases/arrow-and-generics-b.test.js";
|
|
3
|
+
import "./integration-cases/full-module-and-promises.test.js";
|
|
4
|
+
import "./integration-cases/await-and-intrinsics.test.js";
|
|
5
|
+
import "./integration-cases/clr-iterable-overloads.test.js";
|
|
6
|
+
import "./integration-cases/regression-coverage-a.test.js";
|
|
7
|
+
import "./integration-cases/regression-coverage-b.test.js";
|
|
8
|
+
import "./integration-cases/regression-coverage-c.test.js";
|
|
9
|
+
import "./integration-cases/object-literals-and-channels.test.js";
|
|
1224
10
|
//# sourceMappingURL=integration.test.js.map
|