[torque]: Implement Generics for Builtins and Macros
Including specialization, e.g.: // Declare parameterized generic macro GenericMacroTest<T: type>(param: T): Object { return Undefined; } // Declare specialization of generic GenericMacroTest<Object>(param: Object): Object { return param; } ... assert(GenericMacroTest<Smi>(0) == Undefined); assert(GenericMacroTest<Smi>(1) == Undefined); assert(GenericMacroTest<Object>(Null) == Null); assert(GenericMacroTest<Object>(False) == False); ... Known issue: specialization doesn't rigorously checked to verify that specialization signature precisely matches generic declaration. Change-Id: I9d9d96da4c5c8c9a76550844680e9e133a5edaed Reviewed-on: https://chromium-review.googlesource.com/1043986 Commit-Queue: Daniel Clifford <danno@chromium.org> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#53203}
Showing
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Please
register
or
sign in
to comment