Dataphor icon indicating copy to clipboard operation
Dataphor copied to clipboard

D4 generic type failures

Open duncand opened this issue 8 years ago • 0 comments

Dataphoria is having a number of failures in handling generic declared types.

For a baseline, run the following D4 code:

create session operator Foo() : table {x: Integer, y: Integer}
begin
  result := table { row { 42 x, 17 y }, row {29 x, -1 y} };
end;

select Foo();

This correctly produces 2 rows.

Next take this variant which differs only by a more generic declared return type:

create session operator Foo() : table
begin
  result := table { row { 42 x, 17 y }, row {29 x, -1 y} };
end;

select Foo();

The result of running that is Statement executed successfully, returning 0 rows which is wrong; the result should be the same 2 rows.

Next take this variant which changes the declared return type again to even be more generic:

create session operator Foo() : generic
begin
  result := table { row { 42 x, 17 y }, row {29 x, -1 y} };
end;

select Foo();

That outputs <Unknown Result Type: System.Generic> Statement executed successfully which is likewise wrong, and the result should be the same 2 rows.

duncand avatar Jul 03 '17 06:07 duncand