Skip to content

Add Template type#13

Closed
AliiiBenn wants to merge 6 commits intomainfrom
add-template-type
Closed

Add Template type#13
AliiiBenn wants to merge 6 commits intomainfrom
add-template-type

Conversation

@AliiiBenn
Copy link
Member

Summary

  • Add Template[*Parts] type for building template literal strings
  • Concatenates string literal parts at evaluation time
  • Includes evaluator implementation and comprehensive tests

Test plan

  • All 5 new Template tests pass
  • All existing tests continue to pass

AliiiBenn and others added 6 commits March 4, 2026 13:48
Add the KeyOf[T] type that returns all member names of a class
as a tuple of Literal types, similar to TypeScript's keyof operator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement the evaluator for KeyOf[T] that extracts member names
from class annotations and returns them as a tuple of Literal types.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add comprehensive tests for KeyOf including:
- Basic usage with multiple fields
- Single field class
- Empty class (no fields)
- Class with methods (methods ignored)
- Inheritance (includes parent fields)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Template[*Parts] type that builds template literal strings
by concatenating string parts at evaluation time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement the evaluator for Template[*Parts] that concatenates
all string literal parts into a single Literal string.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add comprehensive tests for Template including:
- Basic string concatenation
- Using type variables
- Single part
- Empty string
- Multiple parts forming paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AliiiBenn AliiiBenn closed this Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant