/** * Binary operator expression emitter — main dispatch function. * * Extracted from binary-emitter.ts — contains the emitBinary entry point * that handles comparison, nullish, arithmetic, and standard binary operators. * The `instanceof` special case is delegated to binary-special-ops.ts. * * NEW NUMERIC SPEC: * - Literals use raw lexeme (no contextual widening) * - Integer casts only from IrCastExpression (not inferred from expectedType) * - Binary ops: int op int = int, double op anything = double (C# semantics) */ import { IrExpression, IrType } from "@tsonic/frontend"; import { EmitterContext } from "../../types.js"; import type { CSharpExpressionAst } from "../../core/format/backend-ast/types.js"; /** * Emit a binary operator expression as CSharpExpressionAst * * NEW NUMERIC SPEC: No contextual type propagation for numeric literals. * Literals use their raw lexeme - C# will naturally handle int + int = int, * int + double = double, etc. * * Explicit casts come from IrCastExpression nodes (generated by type-checker * when user intent allows int -> double coercion). * * STRING INDEXER FIX: In C#, string[int] returns char, not string. * When comparing a string indexer result with a single-character string literal, * we emit the string as a char literal to avoid CS0019 (char == string). * * @param expr - The binary expression * @param context - Emitter context * @param _expectedType - Currently unused */ export declare const emitBinary: (expr: Extract, context: EmitterContext, _expectedType?: IrType) => [CSharpExpressionAst, EmitterContext]; //# sourceMappingURL=binary-dispatch.d.ts.map