import { Type } from "./Type"; export enum ConcreteClassType { STRUCT, MONITOR } export class ClassType extends Type { constructor(readonly className: string, readonly concreteClassType: ConcreteClassType) { super(); } override equals(otherType: Type): boolean { if (otherType instanceof ClassType) { return this.className === otherType.className && this.concreteClassType === otherType.concreteClassType; } else { return false; } } override isAssignableTo(otherType: Type): boolean { return this.equals(otherType); } override toString(): string { return `${this.concreteClassTypeName} ${this.className}`; } get concreteClassTypeName(): string { if (this.concreteClassType == ConcreteClassType.STRUCT) { return "struct"; } else { return "monitor"; } } }