Skip to content

bug in class-local scope #136

@lutzhamel

Description

@lutzhamel

The following program incorrectly allows the user to access class member variables without object identity,

load system io.

structure A with
   data a.
   data b.
   data c.

   function __init__
      with none do
        io @println (a,b,c,__init__).
        io @println (this @a, this @b, this @c, this @__init__).
        io @println d.
      end
end

let o = A().

prints out,

(0,1,2,3)
(none,none,none,(function ...))
Error: members.ast: 12: 'd' is not defined

where the first line of the output prints out the memory indexes of the individual structure members, including function members. The second line is correct output when the object identity is given.
The third line is the expected behavior for all member variables given without object identity.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions