You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
documentationIssues or enhancements related to the documentation.good first issueIssues that are good for newcomers or first-time contributors.needs testingIssues that require additional testing or verification.
Generic structs, generic functions, nested type arguments, and generic method specialization are covered by parser/compiler tests, but there is no small maintained example dedicated to teaching the feature.
The existing WebAssembly smoke example uses generics as one feature among many, which makes it a poor reference for someone learning the syntax.
Scope
Add a focused runnable example under examples/ that demonstrates the currently supported generic syntax without introducing unrelated platform or standard-library behavior.
Include:
a generic Box<T>-style struct;
a Pair<A, B>-style struct with two type parameters;
a generic function called with an explicit type argument;
construction and field access for generic structs;
at least one nested generic type such as Pair<i32, Box<i64>>.
Keep the example aligned with the syntax and semantics already covered by the frontend generic tests.
Completion criteria
The example passes wavec check and runs successfully on a normal hosted target.
It demonstrates more than one concrete generic instantiation.
Nested generic type arguments are included without turning the file into a stress test.
No unsupported generic feature is documented implicitly.
The example is listed in the examples index or local README.
documentationIssues or enhancements related to the documentation.good first issueIssues that are good for newcomers or first-time contributors.needs testingIssues that require additional testing or verification.
Activity