Test case with target which is a function returning an access type.

From: Chuck Swart <cswart_at_.....>
Date: Thu May 04 2006 - 23:53:45 PDT
Here is an appropriate test case in which the target is an indexed name.

Another, slightly simpler example would be (using declarations in the 
attached code

Suggested wording:

The determination of the type of the target of a variable assignments 
statement may require determination
of the type of the expression if the target is an indexed name, slice 
name or selected name where the prefix denotes a function returning an 
access type.

Ok, this wording might not be especially good either.



entity ajay is
  
end ajay;

architecture a of ajay is

begin  -- a

  process
    type line is access string;
    variable line1 : line := new string'("line1");
    variable line2 : line := new string'("line2");
    variable line3 : line := null;
    impure function foo (
      in1 : integer)
      return line is
    begin
        if in1=1 then
          return line1;
        else
          return line2;
        end if;
    end foo;
  begin  -- process
    line3 := foo(2);                    -- just a test of basic functionality
    foo(1).all := "abcde";                  -- line1 changes from "line1" to "abcde"
    foo(2)(3) := 'X';                   -- line2 character 3 ('n') changed to 'X'
    wait;
  end process;

end a;
Received on Thu May 4 23:53:47 2006

This archive was generated by hypermail 2.1.8 : Thu May 04 2006 - 23:53:48 PDT