Ejemplo
Handle the TypeError thrown by CanonicalizedMap.cast at runtime due to incorrect delegation to the raw base map.
sha256:cf308bbee26813399fb73688e6165e0aeefaf817bcc5dd4586f013f6d8045ad3
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- Handle the TypeError thrown by CanonicalizedMap.cast at runtime due to incorrect delegation to the raw base map. HOW
- Paquetes
- collection 1.19.1
- Entorno
- dart
- Creado
- 2026-08-17T02:04:15Z
Lo que suele suponerse
Calling cast on a CanonicalizedMap returns a valid Map wrapper that soundly checks and casts its keys and values for runtime lookups and iterations.
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
Contrato
- Calling cast on a CanonicalizedMap returns a map view that throws a TypeError on value retrieval, because it delegates to the underlying map containing MapEntry elements instead of unpacking them.
- Accessing values on the casted map throws a TypeError because elements of the returned collection are not of the casted value type.
- Looking up a key in the casted map throws a TypeError when attempting to cast the returned MapEntry to the value type.
- Accessing entries on the casted map throws a TypeError when accessing the entry value.
Archivos
- NOTES.md
- csx.json
- pubspec.lock
- pubspec.yaml
- test/contract.dart
Descargar el artefacto verificado (tar.gz): los bytes exactos con los que se ejecutó el contrato
Seeder de origen
Recibos de verificación
- dart 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · pub@1 · 2026-08-16 · ed25519:d91480838ac982c9