Minor fixes

This commit is contained in:
Voloshin Bogdan 2018-04-20 12:03:38 +03:00
parent 238b2ed91e
commit efa25e3c61
3 changed files with 9 additions and 4 deletions

View file

@ -18,7 +18,7 @@ end;
begin
var v1, v2, v3, res: integer;
res := Sum3&<integer>(v1, v2, v3);
res := Sum3&[integer](v1, v2, v3);
Write(res);
end.

View file

@ -53,7 +53,13 @@
end;
end;*)
//function Sum3<T, SumTCT>(v1, v2, v3: T): T; where SumTCT: SumTC<T>, constructor;
(*
function Sum3<T, SumTCT>(v1, v2, v3: T): T; where SumTCT: SumTC<T>, constructor;
begin
var s := ConceptSingleton&<SumTCT>.&Instance;
Result := s.sum(v1, s.sum(v2, v3));
end;
*)
function Sum3<T>(v1, v2, v3: T): T; where SumTC[T];
begin
Result := SumTC&[T].sum(v1, SumTC&[T].sum(v2, v3));
@ -61,6 +67,4 @@ end;
begin
write(Sum3&<integer, SumTC_integer>(1, 2, 3));
end.

View file

@ -223,6 +223,7 @@ namespace SyntaxVisitors.TypeclassVisitors
{
// TODO: Check tcr.name - typeclass from where
// TODO: Check - that there is such typeclass with such args at where
// TODO: Ensure that we don't replace another constraint funciton call
var str = tcr.template_params.params_list
.Select(x => (x as named_type_reference).names[0].name)
.Aggregate((tcr.name as ident).name, (x, y) => x + y);