Skip to content

Fix comptime generics as variables#1628

Merged
alimpfard merged 2 commits into
SerenityOS:mainfrom
alimpfard:emit-nttp
Feb 24, 2026
Merged

Fix comptime generics as variables#1628
alimpfard merged 2 commits into
SerenityOS:mainfrom
alimpfard:emit-nttp

Conversation

@alimpfard

Copy link
Copy Markdown
Member

now we can finally say

fn foo<comptime x: String>() -> String => x

and have it not blow up the compiler :)

This is useful as C++ NTTPs are limited in what they can be, specifying
the type allows the compiler to omit the unusable ones from codegen.
...unless they're of a trivial type which C++ can safely have as an
NTTP.
@alimpfard
alimpfard merged commit 04b371f into SerenityOS:main Feb 24, 2026
5 of 6 checks passed
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