I have just added.
begin
pinteger:=@mr.c;
a:=pinteger^;
mr.c:=@a^;
end
=>
.entrypoint
ldsflda valuetype Myrecord mr
ldflda int32 Myrecord::c
stsfld int32* pinteger
ldsfld int32* pinteger
ldobj int32
stsfld int32 a
ldsflda valuetype Myrecord mr
ldsflda int32 a
ldobj int32
stfld int32 Myrecord::c
ret
понедельник, 8 ноября 2010 г.
среда, 3 ноября 2010 г.
Test YAR Type inference
Todays working sample
function abc < T,U > (a:T):^U;
begin
end
pinteger:^integer;
d:double;
pinteger:=abc(d);
=> T=double
=> U=integer
So generic operators like @, [], sizeof .. to come very soon.
function abc < T,U > (a:T):^U;
begin
end
pinteger:^integer;
d:double;
pinteger:=abc(d);
=> T=double
=> U=integer
So generic operators like @, [], sizeof .. to come very soon.
вторник, 2 ноября 2010 г.
YAR and Type inference
Working on support Type Inference in YAR.
A sample:
mr:Myrecord;
a,b:integer;
d:double;
function GenericFunc < T, U , Z> (var a:T;b:U):Z;
begin
end;
..
begin
GenericFunc(a,a):=d; //I know this function result is not a lvalue.
//I relax the assign op type checking rules
//to test of infering of result type
A sample:
mr:Myrecord;
a,b:integer;
d:double;
function GenericFunc < T, U , Z> (var a:T;b:U):Z;
begin
end;
..
begin
GenericFunc(a,a):=d; //I know this function result is not a lvalue.
//I relax the assign op type checking rules
//to test of infering of result type
Подписаться на:
Сообщения (Atom)