fixed fix #1980
This commit is contained in:
parent
4aaa4c2a3b
commit
fdab8e0955
|
|
@ -12,7 +12,7 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("CodeCompletion")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2005-2018 by Ivan Bondarev, Stanislav Mihalkovich")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2005-2019 by Ivan Bondarev, Stanislav Mihalkovich")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Optimizer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2005-2018 by Ivan Bondarev, Stanislav Mihalkovich")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2005-2019 by Ivan Bondarev, Stanislav Mihalkovich")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ begin
|
|||
var b: t1;
|
||||
a := b as T;
|
||||
p2&<t1>(b);
|
||||
p2&<T>(a);
|
||||
assert(a = nil);
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -3048,7 +3048,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
}
|
||||
else
|
||||
{
|
||||
if (tp.is_generic_parameter && !tp.is_class)
|
||||
if (tp.is_generic_parameter && !tp.is_class && !(tp.base_type != null && tp.base_type.is_class))
|
||||
AddError(get_location(node.type_def), "OPERATOR_AS_CAN_NOT_BE_USED_WITH_GENERIC_PARAMETER_{0}_WITHOUT_CLASS_CONSTRAINT", tp.name);
|
||||
if (tp.is_value_type)
|
||||
AddError(get_location(node.type_def), "OPERATOR_AS_MUST_BE_USED_WITCH_A_REFERENCE_TYPE_VALUETYPE{0}", tp.PrintableName);
|
||||
|
|
@ -12361,8 +12361,8 @@ namespace PascalABCCompiler.TreeConverter
|
|||
type_node spec_type = ret.visit(ntr);
|
||||
if (spec_type is ref_type_node || spec_type == SystemLibrary.SystemLibrary.void_type || spec_type == SystemLibrary.SystemLibrary.pointer_type)
|
||||
AddError(new SimpleSemanticError(get_location(specificators[i]), "INAVLID_TYPE"));
|
||||
if (spec_type.is_class)
|
||||
param.is_class = true;
|
||||
//if (spec_type.is_class)
|
||||
// param.is_class = true;
|
||||
if (spec_type.IsInterface)
|
||||
{
|
||||
if (used_interfs[spec_type] != null)
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ namespace PascalABCCompiler.TreeRealization
|
|||
{
|
||||
generic_parameter_eliminations gpe = gpe_list[i];
|
||||
type_node tn = tparams[i];
|
||||
if (gpe.is_class && !tn.is_class)
|
||||
if (gpe.is_class && !tn.is_class && !(tn.base_type != null && tn.base_type.is_class))
|
||||
{
|
||||
return new SimpleSemanticError(null, "PARAMETER_{0}_MUST_BE_REFERENCE_TYPE", tn.PrintableName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ A copy of the GNU GPL is appended to this file.
|
|||
|
||||
IMPORTANT PascalABC.NET LICENSE TERMS
|
||||
|
||||
Copyright (C) 2005-2018 by Ivan Bondarev, Stanislav Mihalkovich
|
||||
Copyright (C) 2005-2019 by Ivan Bondarev, Stanislav Mihalkovich
|
||||
This program is free software; you may redistribute and/or modify it under the terms of the GNU LGPL version 3 with the clarifications and exceptions described below.
|
||||
|
||||
PascalABC.NET can be linked with non-free modules and libraries. This condition is mainly concerned with possibility of adding foreign modules and libraries to PascalABC.NET, aimed at education. In particular, PascalABC.NET includes as a part PROGRAMMING TASKBOOK FOR PASCALABC.NET (in agreement with the author of this product), which is distributed under the terms of proprietary license (see \bin\PT4)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Copyright (C) 2005-2018 by Ivan Bondarev, Stanislav Mihalkovich
|
||||
Copyright (C) 2005-2019 by Ivan Bondarev, Stanislav Mihalkovich
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
ВАЖНЕЙШИЕ УСЛОВИЯ РАСПРОСТРАНЕНИЯ ПРОДУКТА PascalABC.NET
|
||||
|
||||
Copyright (C) 2005-2018 by Ivan Bondarev, Stanislav Mihalkovich
|
||||
Copyright (C) 2005-2019 by Ivan Bondarev, Stanislav Mihalkovich
|
||||
Это программное обеспечение является свободным; вы можете распространять и/или
|
||||
модифицировать его на условиях GNU LGPL версии 3 с разъяснениями и исключениями, данными ниже.
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ using System.Runtime.CompilerServices;
|
|||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2005-2018 by Ivan Bondarev, Stanislav Mihalkovich")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2005-2019 by Ivan Bondarev, Stanislav Mihalkovich")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ using System.Runtime.CompilerServices;
|
|||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2005-2018 by Ivan Bondarev, Stanislav Mihalkovich")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2005-2019 by Ivan Bondarev, Stanislav Mihalkovich")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue