| | |
| | | } |
| | | #endif |
| | | |
| | | const int LIB_VERSION_EXPECT = 104; |
| | | const int LIB_VERSION_EXPECT = 105; |
| | | |
| | | public LuaEnv() |
| | | { |
| | |
| | | local rawget = rawget |
| | | local setmetatable = setmetatable |
| | | local import_type = xlua.import_type |
| | | local import_generic_type = xlua.import_generic_type |
| | | local load_assembly = xlua.load_assembly |
| | | |
| | | function metatable:__index(key) |
| | |
| | | |
| | | -- A non-type has been called; e.g. foo = System.Foo() |
| | | function metatable:__call(...) |
| | | error('No such type: ' .. rawget(self,'.fqn'), 2) |
| | | local n = select('#', ...) |
| | | local fqn = rawget(self,'.fqn') |
| | | if n > 0 then |
| | | local gt = import_generic_type(fqn, ...) |
| | | if gt then |
| | | return rawget(CS, gt) |
| | | end |
| | | end |
| | | error('No such type: ' .. fqn, 2) |
| | | end |
| | | |
| | | CS = CS or {} |