implements input on stdlib

This commit is contained in:
2026-03-24 13:42:24 +00:00
parent a26237cb87
commit 5bfb70979f
3 changed files with 89 additions and 1 deletions
@@ -94,9 +94,10 @@ class PbsGateUSdkInterfaceConformanceTest {
"""
import { Color } from @core:color;
import { Gfx } from @sdk:gfx;
import { Input, InputPad, InputButton } from @sdk:input;
declare contract Renderer {
fn render(gfx: Gfx, color: Color) -> void;
fn render(gfx: Gfx, color: Color, input: Input, pad: InputPad, button: InputButton) -> void;
}
""",
"pub contract Renderer;",
@@ -108,6 +109,11 @@ class PbsGateUSdkInterfaceConformanceTest {
d.getCode().equals(PbsLinkErrors.E_LINK_IMPORT_SYMBOL_UNRESOLVED.name())));
assertTrue(positive.irBackend().getReservedMetadata().builtinTypeSurfaces().stream()
.anyMatch(t -> t.sourceTypeName().equals("Color")));
assertTrue(positive.irBackend().getReservedMetadata().builtinTypeSurfaces().stream()
.anyMatch(t -> t.sourceTypeName().equals("Input") && t.canonicalTypeName().equals("input")));
assertTrue(positive.irBackend().getReservedMetadata().builtinTypeSurfaces().stream()
.anyMatch(t -> t.sourceTypeName().equals("InputButton")
&& t.intrinsics().stream().anyMatch(i -> i.canonicalName().equals("hold"))));
assertTrue(positive.irBackend().getReservedMetadata().hostMethodBindings().stream()
.anyMatch(h -> h.ownerName().equals("Gfx")));