[FEAT] interface + impl 支持! Duck Typing + 严格的检查让语言健壮 [FEAT][IMPL] 增加辅助函数 isTypeMatch等 [IMPL] TypeInfo构造函数FString 现在 explicit
20 lines
401 B
C++
20 lines
401 B
C++
#pragma once
|
|
|
|
#include <Ast/Statements/InterfaceDefSt.hpp>
|
|
#include <Value/Type.hpp>
|
|
|
|
#include <vector>
|
|
|
|
namespace Fig
|
|
{
|
|
struct InterfaceType
|
|
{
|
|
TypeInfo type;
|
|
std::vector<Ast::InterfaceMethod> methods;
|
|
|
|
bool operator==(const InterfaceType &other) const
|
|
{
|
|
return type == other.type; // only compare type info (chain -> typeinfo.id)
|
|
}
|
|
};
|
|
} |