[Feat] 支持运算符重载!详见文档或 Library/lang/lang.fig中的定义。通过 impl Operation for xxx实现重载

[Impl] 函数参数指定现在也接受一个 exp,逐渐改动其他中...
This commit is contained in:
2026-02-02 16:11:08 +08:00
parent 41bff72d44
commit 01c16dee3f
20 changed files with 698 additions and 355 deletions

View File

@@ -28,6 +28,7 @@ namespace Fig::Builtins
Ast::FunctionParameters({}, {}),
std::make_shared<Ast::VarExprAst>(u8"String"),
nullptr)}))},
{u8"Operation", std::make_shared<Object>(InterfaceType(getOperationInterfaceTypeInfo(), {}))},
{u8"Any", std::make_shared<Object>(StructType(ValueType::Any, nullptr, {}, true))},
{u8"Int", std::make_shared<Object>(StructType(ValueType::Int, nullptr, {}, true))},