public void Visit(DispatchExplicitNode node) { node.Expression.Accept(this); if (node.IdType.Text == "Object") { node.IdType = new TypeNode(node.Expression.Line, node.Expression.Column, node.Expression.StaticType.Text); } if (!scope.IsDefinedType(node.IdType.Text, out TypeInfo typeSuperClass)) { errors.Add(SemanticError.NotDeclaredType(node.IdType)); } if (!(node.Expression.StaticType <= typeSuperClass)) { errors.Add(SemanticError.CannotConvert(node, node.Expression.StaticType, typeSuperClass)); } node.Arguments.ForEach(x => x.Accept(this)); var scopeSuperClass = typeSuperClass.ClassReference.Scope; if (!(scopeSuperClass.IsDefined(node.IdMethod.Text, node.Arguments.Select(x => x.StaticType).ToArray(), out node.StaticType))) { errors.Add(SemanticError.NotDeclareFunction(node, node.IdMethod.Text)); } }
public void Visit(DispatchImplicitNode node) { node.Arguments.ForEach(expArg => expArg.Accept(this)); if (!scope.IsDefined(node.IdMethod.Text, node.Arguments.Select(x => x.StaticType).ToArray(), out node.StaticType)) { errors.Add(SemanticError.NotDeclareFunction(node, node.IdMethod.Text)); } }