fix #2290
This commit is contained in:
parent
0a504dfc6f
commit
fce27649d1
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
|||
public const string Major = "3";
|
||||
public const string Minor = "7";
|
||||
public const string Build = "1";
|
||||
public const string Revision = "2712";
|
||||
public const string Revision = "2714";
|
||||
|
||||
public const string MainVersion = Major + "." + Minor;
|
||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%COREVERSION%=1
|
||||
%REVISION%=2712
|
||||
%REVISION%=2714
|
||||
%MINOR%=7
|
||||
%MAJOR%=3
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
3.7.1.2712
|
||||
3.7.1.2714
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!define VERSION '3.7.1.2712'
|
||||
!define VERSION '3.7.1.2714'
|
||||
|
|
|
|||
19
TestSuite/isvar1.pas
Normal file
19
TestSuite/isvar1.pas
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
type
|
||||
t1 = class end;
|
||||
t2 = class(t1) end;
|
||||
|
||||
procedure p1<T>(a: t1); where T: class;
|
||||
begin
|
||||
var x: T;
|
||||
if x is t1 then
|
||||
Print(1);
|
||||
|
||||
if a is T(var b) then
|
||||
if b is t2(var c) then
|
||||
Assert(c=c);
|
||||
end;
|
||||
|
||||
begin
|
||||
var a: t1 := new t2;
|
||||
p1&<t2>(a);
|
||||
end.
|
||||
|
|
@ -260,7 +260,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
type_table.is_derived(expressionType, type) ||
|
||||
AreTheSameType(type, expressionType) ||
|
||||
type.IsInterface ||
|
||||
expressionType.IsInterface)
|
||||
expressionType.IsInterface || type.is_generic_parameter || expressionType.is_generic_parameter)
|
||||
return;
|
||||
|
||||
AddError(get_location(matchedExpression), "EXPRESSION_OF_TYPE_{0}_CANNOT_BE_MATCHED_AGAINST_PATTERN_WITH_TYPE_{1}", expressionType.name, type.name);
|
||||
|
|
|
|||
|
|
@ -3104,7 +3104,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
else
|
||||
if (!(type_table.is_derived(en.type, tp) || type_table.is_derived(tp, en.type)
|
||||
|| en.type == tp || en.type == SystemLibrary.SystemLibrary.object_type
|
||||
|| en.type.IsInterface || tp.IsInterface || tp.is_generic_parameter)
|
||||
|| en.type.IsInterface || tp.IsInterface || tp.is_generic_parameter || en.type.is_generic_parameter)
|
||||
)
|
||||
{
|
||||
AddError(loc, "EXPECTED_DERIVED_CLASSES");
|
||||
|
|
|
|||
Loading…
Reference in a new issue