You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add comprehensive support for RBS Record types ({ key: Type }) in TypeProf
with field access, type checking, and error handling capabilities.
## Core Implementation
* **SigTyRecordNode**: Parse and process Record type definitions from RBS
* **Record class**: New type class with field access and matching support
* **Hash integration**: Shared builtin support for Hash and Record types
* **Type compatibility**: Enable Hash-Record interoperability in method calls
## Features
* Field access via [] operator (e.g., record[:name] -> String)
* Proper type checking for Record parameters and return values
* Union type support for Record field values
* Graceful error handling for non-existent field access (returns untyped)
* Hash[Symbol, T] to Record type compatibility
## Test Coverage
Added 9 comprehensive test files covering:
- Basic Record type usage and type propagation
- Field access and nested Record structures
- Hash-Record type compatibility scenarios
- Error handling for invalid field access
- Optional Record types and empty Records
- Array integration with Record types
## Technical Details
Record types are internally represented with a base Hash type to maintain
compatibility with Ruby's hash-like access patterns. Field values are
properly unified into a union type for the underlying Hash value type.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments