bug fix #718
This commit is contained in:
parent
547742e09f
commit
2dab23a7f5
|
|
@ -7846,8 +7846,10 @@ namespace PascalABCCompiler.NETGenerator
|
||||||
il.Emit(OpCodes.Call, ti.assign_meth);
|
il.Emit(OpCodes.Call, ti.assign_meth);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (ti != null)
|
||||||
EmitBox(from, fi.FieldType);
|
EmitBox(from, ti.tp);
|
||||||
|
else
|
||||||
|
EmitBox(from, fi.FieldType);
|
||||||
CheckArrayAssign(to, from, il);
|
CheckArrayAssign(to, from, il);
|
||||||
il.Emit(OpCodes.Stsfld, fi);
|
il.Emit(OpCodes.Stsfld, fi);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -767,15 +767,6 @@ type
|
||||||
d();
|
d();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure BeginT;
|
|
||||||
begin
|
|
||||||
sb := CreateStoryboard;
|
|
||||||
InitAnim(sb);
|
|
||||||
ApplyAllDecorators;
|
|
||||||
sb.Completed += procedure (o, e) -> sb.Children.Clear;
|
|
||||||
sb.Begin;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure InitAnimWait(sb: StoryBoard; waittime: real); virtual;
|
procedure InitAnimWait(sb: StoryBoard; waittime: real); virtual;
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
@ -870,9 +861,34 @@ type
|
||||||
Result := Self;
|
Result := Self;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
private
|
||||||
|
procedure BeginT;
|
||||||
|
begin
|
||||||
|
sb := CreateStoryboard;
|
||||||
|
InitAnim(sb);
|
||||||
|
ApplyAllDecorators;
|
||||||
|
sb.Completed += procedure (o, e) -> sb.Children.Clear;
|
||||||
|
sb.Begin;
|
||||||
|
end;
|
||||||
|
procedure RemoveT := begin
|
||||||
|
sb.Pause;
|
||||||
|
sb := new Storyboard;
|
||||||
|
end;
|
||||||
|
procedure ChangeT(a: MyAnimation);
|
||||||
|
begin
|
||||||
|
sb := CreateStoryboard;
|
||||||
|
Print(a.sb);
|
||||||
|
foreach var d in a.sb.Children do
|
||||||
|
sb.Children.Add(d);
|
||||||
|
Print(2);
|
||||||
|
end;
|
||||||
|
public
|
||||||
procedure &Begin; virtual := Invoke(BeginT);
|
procedure &Begin; virtual := Invoke(BeginT);
|
||||||
procedure Pause := sb.Pause;
|
procedure Remove := Invoke(RemoveT);
|
||||||
procedure Resume := sb.Resume;
|
procedure Change(a: MyAnimation) := Invoke(ChangeT,a);
|
||||||
|
procedure Pause := if sb<>nil then sb.Pause;
|
||||||
|
procedure Resume := if sb<>nil then sb.Resume;
|
||||||
|
|
||||||
function Duration: real; virtual := seconds;
|
function Duration: real; virtual := seconds;
|
||||||
function &Then(second: MyAnimation): MyAnimation;
|
function &Then(second: MyAnimation): MyAnimation;
|
||||||
function Forever: MyAnimation; virtual := Self;
|
function Forever: MyAnimation; virtual := Self;
|
||||||
|
|
@ -880,6 +896,16 @@ type
|
||||||
function AccelerationRatio(acceleration: real; deceleration: real := 0): MyAnimation; virtual := Self;
|
function AccelerationRatio(acceleration: real; deceleration: real := 0): MyAnimation; virtual := Self;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
EmptyAnimation = class(MyAnimation)
|
||||||
|
public
|
||||||
|
constructor(wait: real);
|
||||||
|
begin
|
||||||
|
Self.Seconds := wait;
|
||||||
|
end;
|
||||||
|
procedure InitAnim(sb: StoryBoard); virtual := InitAnimWait(sb, Seconds);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
Double1AnimationBase = class(MyAnimation)
|
Double1AnimationBase = class(MyAnimation)
|
||||||
private
|
private
|
||||||
v: real;
|
v: real;
|
||||||
|
|
@ -1279,6 +1305,8 @@ function operator*(a, b: MyAnimation): MyAnimation; extensionmethod := Animate.G
|
||||||
|
|
||||||
function MyAnimation.&Then(second: MyAnimation): MyAnimation := Self + second;
|
function MyAnimation.&Then(second: MyAnimation): MyAnimation := Self + second;
|
||||||
|
|
||||||
|
function EmptyAnim(sec: real) := EmptyAnimation.Create(sec);
|
||||||
|
|
||||||
//------------------------------ End Animation -------------------------------
|
//------------------------------ End Animation -------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
26
TestSuite/generics15.pas
Normal file
26
TestSuite/generics15.pas
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
type
|
||||||
|
t1<T>=class
|
||||||
|
class l: byte;
|
||||||
|
a: byte;
|
||||||
|
class procedure test;
|
||||||
|
begin
|
||||||
|
t1&<T>.l := 3;
|
||||||
|
assert(t1&<T>.l = 3);
|
||||||
|
end;
|
||||||
|
class procedure test(var a: byte);
|
||||||
|
begin
|
||||||
|
assert(a = 3);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
t1&<byte>.l := 2;
|
||||||
|
t1&<char>.l := 3;
|
||||||
|
assert(t1&<byte>.l = 2);
|
||||||
|
assert(t1&<char>.l = 3);
|
||||||
|
var o := new t1<byte>;
|
||||||
|
o.a := 2;
|
||||||
|
assert(o.a = 2);
|
||||||
|
t1&<char>.test;
|
||||||
|
t1&<char>.test(t1&<char>.l);
|
||||||
|
end.
|
||||||
Loading…
Reference in a new issue