Skip to content

Commit 8c655e7

Browse files
committed
Alias syntax updates.
1 parent 8b01fc6 commit 8c655e7

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

luad/conversions/classes.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ void pushStaticTypeInterface(T)(lua_State* L) if(is(T == class) || is(T == struc
240240
{
241241
enum isFunction = is(typeof(mixin("T." ~ member)) == function);
242242
static if(isFunction)
243-
enum isProperty = isFunction && (functionAttributes!(mixin("T." ~ member)) & FunctionAttribute.property);
243+
enum isProperty = (functionAttributes!(mixin("T." ~ member)) & FunctionAttribute.property);
244244
else
245245
enum isProperty = false;
246246

luad/conversions/functions.d

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ package:
150150
// TODO: right now, virtual functions on specialized classes can be called with base classes as 'self', not safe!
151151
extern(C) int methodWrapper(M, T, bool virtual)(lua_State* L)
152152
{
153-
alias ParameterTypeTuple!M Args;
153+
alias Args = ParameterTypeTuple!M;
154154

155155
static assert ((variadicFunctionStyle!M != Variadic.d && variadicFunctionStyle!M != Variadic.c),
156156
"Non-typesafe variadic functions are not supported.");
@@ -175,9 +175,9 @@ extern(C) int methodWrapper(M, T, bool virtual)(lua_State* L)
175175
{
176176
alias RT = ReturnType!M;
177177
static if(returnsRef!M && isUserStruct!RT)
178-
alias ref RT function(T, Args) VirtualWrapper;
178+
alias VirtualWrapper = ref RT function(T, Args);
179179
else
180-
alias RT function(T, Args) VirtualWrapper;
180+
alias VirtualWrapper = RT function(T, Args);
181181
VirtualWrapper func = cast(VirtualWrapper)lua_touserdata(L, lua_upvalueindex(1));
182182
}
183183
else
@@ -195,14 +195,14 @@ extern(C) int methodWrapper(M, T, bool virtual)(lua_State* L)
195195
{
196196
TreatArgs!(ParameterTypeTuple!VirtualWrapper) allArgs;
197197
allArgs[0] = self;
198-
alias allArgs[1..$] args;
198+
alias args = allArgs[1..$];
199199
}
200200
else
201201
{
202202
// TODO: maybe we should build a tuple of 'ReturnType!(getArgument!(T, i))' for each arg?
203203
// then we could get rid of this TreatArgs! rubbish...
204204
TreatArgs!Args allArgs;
205-
alias allArgs args;
205+
alias args = allArgs;
206206
}
207207

208208
foreach(i, Arg; Args)
@@ -213,7 +213,7 @@ extern(C) int methodWrapper(M, T, bool virtual)(lua_State* L)
213213

214214
extern(C) int functionWrapper(T)(lua_State* L)
215215
{
216-
alias FillableParameterTypeTuple!T Args;
216+
alias Args = FillableParameterTypeTuple!T;
217217

218218
static assert ((variadicFunctionStyle!T != Variadic.d && variadicFunctionStyle!T != Variadic.c),
219219
"Non-typesafe variadic functions are not supported.");
@@ -271,7 +271,7 @@ void pushFunction(T)(lua_State* L, T func) if (isSomeFunction!T)
271271
// TODO: optimize for non-virtual functions
272272
void pushMethod(T, string member)(lua_State* L) if (isSomeFunction!(__traits(getMember, T, member)))
273273
{
274-
alias typeof(mixin("&T.init." ~ member)) M;
274+
alias M = typeof(mixin("&T.init." ~ member));
275275

276276
enum isVirtual = !is(T == struct); // TODO: final methods should also be handled...
277277

0 commit comments

Comments
 (0)