Opened 12 years ago

Closed 12 years ago

#404 closed bug (fixed)

alias doesn't work properly

Reported by: steenpass Owned by: somebody
Priority: minor Milestone: 3-1-4 and higher
Component: dontKnow Version: 3-1-3
Keywords: alias Cc:

Description

> proc dummy1(int a, int b) { return("works"); };
> proc dummy2(alias int a, int b) { return("works"); };
> proc dummy3(int a, alias int b) { return("works"); };
> proc dummy4(alias int a, alias int b) { return("works"); };
> int a, b;
> dummy1(a, b);
works
> dummy2(a, b);
works
> dummy3(a, b);
   ? error occurred in or before ::dummy3 line 0: `parameter int a; parameter  alias int b; `
   ? last reserved name was `alias`
   ? leaving ::dummy3
   skipping text from ` `   ? leaving ::dummy3
 error at token `)`
> dummy4(a, b);
   ? error occurred in or before ::dummy4 line 0: `alias int a; parameter  alias int b; `
   ? last reserved name was `alias`
   ? leaving ::dummy4
   skipping text from ` `   ? leaving ::dummy4
 error at token `)`
> 

It should be possible to have more than one argument as well as only the second (third, etc.) argument as an alias.

Note that alias also causes problems when applied to lists:

> proc dummy1(alias list l) { int i = l[1]; i; };
> proc dummy2(alias list l) { int i = l[1][1]; i; };
> list l1 = list(1, 2);
> list l2 = list(list(1), list(2));
> dummy1(l1);
   ? `int`(i) = `` is not supported
   ? expected `int` = `int`
   ? expected `int` = `intmat`
   ? error occurred in or before ::dummy1 line 1: ` int i = l[1]; i; `
   ? expected int-expression. type 'help int;'
   ? leaving ::dummy1
   skipping text from `;` error at token `)`
> dummy2(l2);
   ? ...parse error
   ? error occurred in or before ::dummy2 line 1: ` int i = l[1][1]; i; `
   ? expected int-expression. type 'help int;'
   ? leaving ::dummy2
   skipping text from `;` error at token `)`
> 

Change History (1)

comment:1 Changed 12 years ago by hannes

Resolution: fixed
Status: newclosed

2 different bug should result in 2 different tickets.

fixed.

Last edited 12 years ago by hannes (previous) (diff)
Note: See TracTickets for help on using tickets.