Skip to content

Always require using Literal for Literal type arguments#48

Merged
msullivan merged 1 commit intomainfrom
no-literal
Jan 24, 2026
Merged

Always require using Literal for Literal type arguments#48
msullivan merged 1 commit intomainfrom
no-literal

Conversation

@msullivan
Copy link
Collaborator

Previously we were allowing stuff like GetArg[T, Base, 0].
This requires it to be GetArg[T, Base, Literal[0]].

This is obviously kind of uglier but means we don't need to propose an
expansion of how literal type are treated. (And, importantly, I don't
think it's possible to reliably make strings work, because of how
strings are treated as type references...)

@msullivan msullivan requested review from 1st1 and dnwpark January 23, 2026 20:04
Previously we were allowing stuff like `GetArg[T, Base, 0]`.
This requires it to be `GetArg[T, Base, Literal[0]]`.

This is obviously kind of uglier but means we don't need to propose an
expansion of how literal type are treated. (And, importantly, I don't
think it's possible to reliably make *strings* work, because of how
strings are treated as type references...)
@msullivan msullivan merged commit 454a987 into main Jan 24, 2026
2 checks passed
@msullivan msullivan deleted the no-literal branch January 24, 2026 01:55
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.

2 participants