ponyc icon indicating copy to clipboard operation
ponyc copied to clipboard

Unable to use object literal field in constructor

Open Theodus opened this issue 9 years ago • 6 comments

In objects you can do the following:

class Foo
  let _x: USize = 0
  let _y: USize = _x

But when this is done for object literals as so:

let x = object
  let _x: USize = 0
  let _y: USize = _x
end

it gives the following error:

can't find declaration of '_x', did you mean 'x'?
      let _y: USize = _x
                      ^

Theodus avatar Oct 01 '16 00:10 Theodus