Files
pplus-library/mojo/stress/overloads.mojo
T
alexm 568474d52f
Test (in pplus-core) / in-core (push) Failing after 28m44s
Initial commit
2026-11-12 22:23:48 -05:00

22 lines
577 B
Mojo

# probe: overloaded functions picked by count and by type
# status: the expected output is Programming+'s interpreter's prediction; corpus.py verify confirms or refutes it on godbolt
# expect-stdout: an Int 3
# expect-stdout: a String hi
# expect-stdout: a pair 1,2
def describe(x: Int) -> String:
return "an Int " + String(x)
def describe(x: String) -> String:
return "a String " + x
def describe(x: Int, y: Int) -> String:
return "a pair " + String(x) + "," + String(y)
def main():
print(describe(3))
print(describe("hi"))
print(describe(1, 2))