Initial commit
Test (in pplus-core) / in-core (push) Failing after 28m44s

This commit is contained in:
alexm committed 2026-11-12 22:23:48 -05:00
commit 568474d52f
1591 files changed
+528213

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
# probe: a trait with a default method, used by two structs
# status: the expected output is Programming+'s interpreter's prediction; corpus.py verify confirms or refutes it on godbolt
# expect-stdout: a shape of area 7.0
# expect-stdout: a square of side 4.0
trait Shape:
def area(self) -> Float64:
...
def describe(self) -> String:
return "a shape of area " + String(self.area())
@fieldwise_init
struct Rect(Shape, Copyable, Movable):
var w: Float64
var h: Float64
def area(self) -> Float64:
return self.w * self.h
@fieldwise_init
struct Square(Shape, Copyable, Movable):
var side: Float64
def area(self) -> Float64:
return self.side * self.side
def describe(self) -> String:
return "a square of side " + String(self.side)
def main():
print(Rect(2.0, 3.5).describe())
print(Square(4.0).describe())