可用的回归测试通过的标准版本

This commit is contained in:
2026-06-18 00:39:43 +08:00
parent bffb0cb6b7
commit e02c867edf
365 changed files with 22562 additions and 24532 deletions

View File

@@ -30,36 +30,36 @@ def double_add[T](a: T, b: T) -> T: pass
class A[T]:
def __init__(self: A, a: T) -> t.CVoid: pass
def __init__(self: A, a: T) -> t.CInt: pass
def get_a(self: A) -> T: pass
class Pair[T1, T2]:
def __init__(self: Pair, first: T1, second: T2) -> t.CVoid: pass
def __init__(self: Pair, first: T1, second: T2) -> t.CInt: pass
def get_first(self: Pair) -> T1: pass
def get_second(self: Pair) -> T2: pass
class Calculator[T]:
def __init__(self: Calculator, init_val: T) -> t.CVoid: pass
def __init__(self: Calculator, init_val: T) -> t.CInt: pass
def compute(self: Calculator, other: T) -> T: pass
def double_compute(self: Calculator, other: T) -> T: pass
class Container[T]:
def __init__(self: Container, v: T) -> t.CVoid: pass
def __init__(self: Container, v: T) -> t.CInt: pass
def get_value(self: Container) -> T: pass
def get_flag(self: Container) -> CInt32T: pass
@t.CVTable
class Shape:
def __init__(self: Shape, x: CFloat64T, y: CFloat64T) -> t.CVoid: pass
def __init__(self: Shape, x: CFloat64T, y: CFloat64T) -> t.CInt: pass
def area(self: Shape) -> CFloat64T: pass
def perimeter(self: Shape) -> CFloat64T: pass
def describe(self: Shape) -> CFloat64T: pass
@t.CVTable
class Circle(Shape):
def __init__(self: Circle, x: CFloat64T, y: CFloat64T, r: CFloat64T) -> t.CVoid: pass
def __init__(self: Circle, x: CFloat64T, y: CFloat64T, r: CFloat64T) -> t.CInt: pass
def area(self: Circle) -> CFloat64T: pass
def perimeter(self: Circle) -> CFloat64T: pass
def scale(self: Circle, factor: CFloat64T) -> 'Circle' | CPtr: pass
def move(self: Circle, dx: CFloat64T, dy: CFloat64T) -> 'Circle' | CPtr: pass
@t.CVTable
class Rect(Shape):
def __init__(self: Rect, x: CFloat64T, y: CFloat64T, w: CFloat64T, h: CFloat64T) -> t.CVoid: pass
def __init__(self: Rect, x: CFloat64T, y: CFloat64T, w: CFloat64T, h: CFloat64T) -> t.CInt: pass
def area(self: Rect) -> CFloat64T: pass
def perimeter(self: Rect) -> CFloat64T: pass
def scale(self: Rect, factor: CFloat64T) -> 'Rect' | CPtr: pass
@@ -67,7 +67,7 @@ class Vec2:
x: CFloat64T
y: CFloat64T
def __new__() -> 'Vec2' | CPtr: pass
def __init__(self: Vec2, x: CFloat64T, y: CFloat64T) -> t.CVoid: pass
def __init__(self: Vec2, x: CFloat64T, y: CFloat64T) -> t.CInt: pass
def __add__(self: Vec2, b: 'Vec2' | CPtr) -> 'Vec2' | CPtr: pass
def __sub__(self: Vec2, b: 'Vec2' | CPtr) -> 'Vec2' | CPtr: pass
def __mul__(self: Vec2, s: CFloat64T) -> 'Vec2' | CPtr: pass
@@ -79,7 +79,7 @@ class Vec3:
y: CFloat64T
z: CFloat64T
def __new__() -> 'Vec3' | CPtr: pass
def __init__(self: Vec3, x: CFloat64T, y: CFloat64T, z: CFloat64T) -> t.CVoid: pass
def __init__(self: Vec3, x: CFloat64T, y: CFloat64T, z: CFloat64T) -> t.CInt: pass
def __add__(self: Vec3, b: 'Vec3' | CPtr) -> 'Vec3' | CPtr: pass
def __sub__(self: Vec3, b: 'Vec3' | CPtr) -> 'Vec3' | CPtr: pass
def __mul__(self: Vec3, s: CFloat64T) -> 'Vec3' | CPtr: pass
@@ -89,14 +89,14 @@ class Vec3:
def len_sq(self: Vec3) -> CFloat64T: pass
@t.CVTable
class Dog:
def __init__(self: Dog, name_val: CInt, bark_power: CInt32T) -> t.CVoid: pass
def __init__(self: Dog, name_val: CInt, bark_power: CInt32T) -> t.CInt: pass
def speak(self: Dog) -> CInt: pass
def bite(self: Dog) -> CInt32T: pass
def take_damage(self: Dog, dmg: CInt32T) -> 'Dog' | CPtr: pass
def is_alive(self: Dog) -> CInt: pass
@t.CVTable
class Cat:
def __init__(self: Cat, name_val: CInt, lives: CInt32T) -> t.CVoid: pass
def __init__(self: Cat, name_val: CInt, lives: CInt32T) -> t.CInt: pass
def speak(self: Cat) -> CInt: pass
def scratch(self: Cat) -> CInt32T: pass
def take_damage(self: Cat, dmg: CInt32T) -> 'Cat' | CPtr: pass
@@ -109,22 +109,22 @@ class Transform:
scale_y: CFloat64T
scale_z: CFloat64T
def __new__() -> 'Transform' | CPtr: pass
def __init__(self: Transform, px: CFloat64T, py: CFloat64T, pz: CFloat64T) -> t.CVoid: pass
def __init__(self: Transform, px: CFloat64T, py: CFloat64T, pz: CFloat64T) -> t.CInt: pass
def apply_scale(self: Transform, sx: CFloat64T, sy: CFloat64T, sz: CFloat64T) -> 'Transform' | CPtr: pass
def world_position(self: Transform) -> 'Vec3' | CPtr: pass
@t.CVTable
class Vehicle:
def __init__(self: Vehicle, speed: CInt32T) -> t.CVoid: pass
def __init__(self: Vehicle, speed: CInt32T) -> t.CInt: pass
def move(self: Vehicle) -> CInt: pass
def is_running(self: Vehicle) -> CInt: pass
@t.CVTable
class Car(Vehicle):
def __init__(self: Car, speed: CInt32T, doors: CInt32T) -> t.CVoid: pass
def __init__(self: Car, speed: CInt32T, doors: CInt32T) -> t.CInt: pass
def honk(self: Car) -> CInt: pass
@t.CVTable
class ElectricCar(Car):
def __init__(self: ElectricCar, speed: CInt32T, doors: CInt32T, battery: CInt32T) -> t.CVoid: pass
def charge(self: ElectricCar) -> t.CVoid: pass
def __init__(self: ElectricCar, speed: CInt32T, doors: CInt32T, battery: CInt32T) -> t.CInt: pass
def charge(self: ElectricCar) -> t.CInt: pass
def move(self: ElectricCar) -> CInt: pass
def main() -> CInt | CExport: pass