bug fix #2383
This commit is contained in:
parent
ea848d7907
commit
84d47e6e71
|
|
@ -8212,7 +8212,7 @@ function LogN(base, x: real) := Math.Log(x) / Math.Log(base);
|
||||||
|
|
||||||
function Sqrt(x: real) := Math.Sqrt(x);
|
function Sqrt(x: real) := Math.Sqrt(x);
|
||||||
|
|
||||||
function Sqr(x: integer): int64 := x * x;
|
function Sqr(x: integer): int64 := int64(x) * int64(x);
|
||||||
|
|
||||||
function Sqr(x: shortint): integer := x * x;
|
function Sqr(x: shortint): integer := x * x;
|
||||||
|
|
||||||
|
|
@ -8222,11 +8222,11 @@ function Sqr(x: BigInteger): BigInteger := x * x;
|
||||||
|
|
||||||
function Sqr(x: byte): integer := x * x;
|
function Sqr(x: byte): integer := x * x;
|
||||||
|
|
||||||
function Sqr(x: word): uint64 := x * x;
|
function Sqr(x: word): uint64 := uint64(x) * uint64(x);
|
||||||
|
|
||||||
function Sqr(x: longword): uint64 := x * x;
|
function Sqr(x: longword): uint64 := uint64(x) * uint64(x);
|
||||||
|
|
||||||
function Sqr(x: int64): int64 := x * x;
|
function Sqr(x: int64): int64 := int64(x) * int64(x);
|
||||||
|
|
||||||
function Sqr(x: uint64): uint64 := x * x;
|
function Sqr(x: uint64): uint64 := x * x;
|
||||||
|
|
||||||
|
|
|
||||||
26
TestSuite/lambdas_generics10.pas
Normal file
26
TestSuite/lambdas_generics10.pas
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
type
|
||||||
|
|
||||||
|
t0<T> = class
|
||||||
|
where T: t0<T>;
|
||||||
|
b: boolean;
|
||||||
|
|
||||||
|
static procedure p1(a: T);
|
||||||
|
begin
|
||||||
|
var f: Func<T, boolean> := o -> o.b;
|
||||||
|
assert(f(a));
|
||||||
|
end;
|
||||||
|
|
||||||
|
static procedure p2(a: T);
|
||||||
|
begin
|
||||||
|
assert(a.b);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
t1 = class(t0<t1>) end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
var a := new t1;
|
||||||
|
a.b := true;
|
||||||
|
t1.p1(a);
|
||||||
|
t1.p2(a);
|
||||||
|
end.
|
||||||
|
|
@ -11974,6 +11974,8 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
{
|
{
|
||||||
make_attributes_for_declaration(_type_declaration, ctn);
|
make_attributes_for_declaration(_type_declaration, ctn);
|
||||||
}
|
}
|
||||||
|
if (cl_def.keyword == class_keyword.Class || cl_def.keyword == class_keyword.Interface)
|
||||||
|
ctn.is_class = true;//nado ranshe pomechat kak is_class
|
||||||
if (is_generic)
|
if (is_generic)
|
||||||
{
|
{
|
||||||
if (predefined_generic)
|
if (predefined_generic)
|
||||||
|
|
@ -12011,6 +12013,7 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
AddError(get_location(cl_def.class_parents.types[i]), "PARTIAL_CLASS_PARENTS_MISMATCH");
|
AddError(get_location(cl_def.class_parents.types[i]), "PARTIAL_CLASS_PARENTS_MISMATCH");
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
visit_where_list(cl_def.where_section);
|
visit_where_list(cl_def.where_section);
|
||||||
|
|
||||||
CheckWaitedRefTypes(ctn);
|
CheckWaitedRefTypes(ctn);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue