bug fix issue #104

This commit is contained in:
Бондарев Иван 2016-03-10 19:43:13 +01:00
parent 907ad3fc86
commit 034a13f70c

View file

@ -11608,6 +11608,8 @@ namespace PascalABCCompiler.TreeConverter
{
if (cnfn.parameters.Count != 1)
AddError(new SimpleSemanticError(cnfn.loc,"EXTENSION_METHODS_MUST_HAVE_LEAST_ONE_PARAMETER"));
if (cnfn.ConnectedToType == null)
AddError(new SimpleSemanticError(cnfn.loc, "OPERATOR_SHOULD_BE_EXTENSION_METHOD"));
if (!convertion_data_and_alghoritms.eq_type_nodes(tn, cnfn.ConnectedToType) && !convertion_data_and_alghoritms.eq_type_nodes(cnfn.ConnectedToType as type_node, cnfn.parameters[0].type))
{
AddError(get_location(_function_header.return_type), "RETURN_VALUE_SHOULD_HAVE_TYPE_{0}", (cnfn.ConnectedToType as type_node).PrintableName);