Parent namespace prefix are missed in all the rest classes except the one firstly scaned by TSTL if more than one classes are declared in the same "export" sub namespace nested with its parent namespace.
Class Test1 in Test1.ts
namespace _ns {
export namespace _inner_ns {
export class Test1 {
public static func() :void {}
}
}
}
Class Test2 in Test2.ts
namespace _ns {
export namespace _inner_ns {
export class Test2 {
public static func() :void {}
}
}
}
Test1 and Test2 included in TestIdx.ts by order:
import "./Test1"
import "./Test2"
lua translated from Test1.ts (which is OK)
_ns = {}
do
_ns._inner_ns = {}
local _inner_ns = _ns._inner_ns
do
_inner_ns.Test1 = {}
local Test1 = _inner_ns.Test1
Test1.name = "Test1"
Test1.__index = Test1
Test1.prototype = {}
Test1.prototype.__index = Test1.prototype
Test1.prototype.constructor = Test1
function Test1.new(...)
local self = setmetatable({}, Test1.prototype)
self:____constructor(...)
return self
end
function Test1.prototype.____constructor(self)
end
function Test1.func(self)
end
end
end
lua translated from Test2.ts (in which parent namespace prefix missed)
do
do
-- now parent namespace "_ns" missed
_inner_ns.Test2 = {}
local Test2 = _inner_ns.Test2
Test2.name = "Test2"
Test2.__index = Test2
Test2.prototype = {}
Test2.prototype.__index = Test2.prototype
Test2.prototype.constructor = Test2
function Test2.new(...)
local self = setmetatable({}, Test2.prototype)
self:____constructor(...)
return self
end
function Test2.prototype.____constructor(self)
end
function Test2.func(self)
end
end
end
Class Test1 would be error if Class Test2 is included before Test1.
thanks!
Parent namespace prefix are missed in all the rest classes except the one firstly scaned by TSTL if more than one classes are declared in the same "export" sub namespace nested with its parent namespace.
Class Test1 in Test1.ts
Class Test2 in Test2.ts
Test1 and Test2 included in TestIdx.ts by order:
lua translated from Test1.ts (which is OK)
lua translated from Test2.ts (in which parent namespace prefix missed)
Class Test1 would be error if Class Test2 is included before Test1.
thanks!