Skip to main content

ErTypeMismatch

ErTypeMismatch = 12

Example

function IsRuntimeTypeMismatch(const ErrorType: TIFException): Boolean;
begin
Result := ErrorType = ErTypeMismatch;
end;

Usage

ErTypeMismatch indicates that known Velox scripting runtime values or types are incompatible for the requested operation.

Formatting and exception state

ExceptionToString ignores Param and returns Type Mismatch. Automatic producers do not include source/destination type names.

Additional Technical Info

ErTypeMismatch is member ordinal 12 of TIFException, the script-visible declaration that is kept in exact ordinal alignment with PascalScript's runtime TPSError. Its sidebar position 40 is alphabetical navigation metadata and is not its enumeration value.

ErTypeMismatch is the runtime incompatibility category used by value assignment/conversion, arithmetic/comparison/set operators, class/interface operations and imported-call adapters. Both involved type records may be valid, but the requested combination or conversion is not supported. Many static mismatches are rejected by the PascalScript compiler. This runtime category remains important for Variants, imported values, dynamically selected operations and corrupted/incompatible bytecode whose types cannot be proven at compile time.

Behavior, recovery and quirks

  • Distinguish it from erInvalidType, which usually means a type record/reference itself is invalid, and from compiler diagnostics which occur before execution.
  • Capture the declaration, actual Variant/base type and operation at the failing procedure/position. The fixed message alone is insufficient.
  • Do not silence the error with broad casts without confirming range, Null, object ownership and interface compatibility.
  • Exception transfer is not a database, dataset, filesystem or external-system transaction. Any earlier side effect remains unless the called API or surrounding Flow provides an explicit rollback contract.
  • Do not persist the numeric ordinal as an integration contract. Store the member name, formatted message, parameter and relevant procedure/position with the Velox version.

Related Code Library entries

External references

Created 2026-07-15