Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

specialization of type declaration based on type arguments + extra #1194

Open
alex-s168 opened this issue Jan 28, 2025 · 1 comment
Open
Assignees

Comments

@alex-s168
Copy link
Contributor

type Arr<t> {
  _data: t[],
  _len: U32
};

// when t is at most 8 bytes wide, inline parts of arr
type Arr<t: Sized<(_<=8)>> {
  _inline: t[4],
  _heap: t[],
  _len: U32
}

// bit array
type Arr<Bool> {
  _data: U8[],
  _bits_len: U32
};
```
@andrew-johnson-4
Copy link
Owner

This is really cool. I 100% support this feature.

It is not "easy" to implement, but I don't think it would be "hard" either.

@andrew-johnson-4 andrew-johnson-4 self-assigned this Jan 29, 2025
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

No branches or pull requests

2 participants