[VER] 0.3.3-alpha
[FEAT] interface + impl 支持! Duck Typing + 严格的检查让语言健壮 [FEAT][IMPL] 增加辅助函数 isTypeMatch等 [IMPL] TypeInfo构造函数FString 现在 explicit
This commit is contained in:
20
src/Value/interface.hpp
Normal file
20
src/Value/interface.hpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#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)
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user