bennyxqg / lua-alchemy

Automatically exported from code.google.com/p/lua-alchemy
0 stars 0 forks source link

Static field interpreted as package path element if try to get property from that field (in lua) #145

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
in as3:
class Class1 {
  public static var field : Class2 = new Class2();
}

class Class 2 {
  public var property : int = 121;
}

in lua:
print(as3.class.Class1.field.property)

throws an lua error

What is the expected output? What do you see instead?
121

What version of the product are you using? On what operating system?
0.2.2 win7 x64

Original issue reported on code.google.com by alexey.a...@gmail.com on 7 May 2011 at 8:43

GoogleCodeExporter commented 9 years ago
err,
instead of 
print(as3.class.Class1.field.property)

need:
as3.tolua(as3.class.Class1.field.property)

bug is in as3.tolua

Original comment by alexey.a...@gmail.com on 24 May 2011 at 8:15

GoogleCodeExporter commented 9 years ago

Original comment by aglad...@gmail.com on 31 May 2011 at 7:46

GoogleCodeExporter commented 9 years ago
See test testPropertyOfStaticInstanceGet in TestSugar suite.

Original comment by aglad...@gmail.com on 3 Jun 2011 at 2:15

GoogleCodeExporter commented 9 years ago
The problem is that the sugar code does not know how to detect if the "field" 
is a part of a class name or a name of static variable.

Any clues on how to properly detect this?

Original comment by aglad...@gmail.com on 3 Jun 2011 at 2:24

GoogleCodeExporter commented 9 years ago

Original comment by aglad...@gmail.com on 26 Feb 2012 at 2:15