-
Notifications
You must be signed in to change notification settings - Fork 340
Open
Labels
Description
Describe the bug
I'm struggling with passing default to valueof template parameter.
Please, clarify what's wrong there.
Reproduction
model Pagination {
offset: uint32,
limit: uint32,
}
model RequestListN<T, DefaultLimit extends valueof uint32 = 30> {
pagination: Pagination = #{ offset: 0, limit: DefaultLimit },
}
// good
model RequestList30 is RequestListN<unknown> {}
// good as well
model RequestList50 is RequestListN<unknown, 50> {}
// bad: DefaultLimit refers to a type, but is being used as a value here.
interface Test<T, DefaultLimit extends valueof uint32 = 30> {
op list(...RequestListN<T, DefaultLimit>): unknown;
}Checklist
- Follow our Code of Conduct
- Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable