make things dynamic (this is because typeparameters cause problems)

This commit is contained in:
lemz1 2024-10-27 20:09:48 +01:00 committed by lemz
parent fc438b853c
commit 0197c977ef

View file

@ -272,19 +272,10 @@ class PolymodMacro
fieldArgs.push(
{
name: arg.name,
type: Context.toComplexType(arg.t),
type: (macro :Dynamic),
opt: arg.opt,
});
}
var fieldParams = [];
for (param in field.params)
{
fieldParams.push(
{
name: param.name,
defaultType: param.defaultType != null ? Context.toComplexType(param.defaultType) : null,
});
}
var strExpr = Context.parse('${cls.module}.${cls.name}.${field.name}(${exprArgs.join(', ')})', Context.currentPos());
@ -296,13 +287,13 @@ class PolymodMacro
kind: FieldType.FFun(
{
args: fieldArgs,
ret: Context.toComplexType(ret),
ret: (macro :Dynamic),
expr: macro
{
@:privateAccess
return ${strExpr};
},
params: fieldParams
params: []
}),
pos: Context.currentPos()
});
@ -315,20 +306,10 @@ class PolymodMacro
name: field.name,
doc: field.doc,
access: [Access.AStatic].concat(getFieldAccess(field)),
kind: FieldType.FProp('get', 'never', actualType, null),
kind: FieldType.FProp('get', 'never', (macro :Dynamic), null),
pos: Context.currentPos()
});
var fieldParams = [];
for (param in field.params)
{
fieldParams.push(
{
name: param.name,
defaultType: param.defaultType != null ? Context.toComplexType(param.defaultType) : null,
});
}
var strExpr = Context.parse('${cls.module}.${cls.name}.${field.name}', Context.currentPos());
fields.push(
@ -339,13 +320,13 @@ class PolymodMacro
kind: FieldType.FFun(
{
args: [],
ret: actualType,
ret: (macro :Dynamic),
expr: macro
{
@:privateAccess
return ${strExpr};
},
params: fieldParams
params: []
}),
pos: Context.currentPos()
});
@ -381,7 +362,7 @@ class PolymodMacro
name: field.name,
doc: field.doc,
access: [Access.AStatic].concat(getFieldAccess(field)),
kind: FieldType.FProp('get', 'never', actualType, null),
kind: FieldType.FProp('get', 'never', (macro :Dynamic), null),
pos: Context.currentPos()
});
@ -395,7 +376,7 @@ class PolymodMacro
kind: FieldType.FFun(
{
args: [],
ret: actualType,
ret: (macro :Dynamic),
expr: macro
{
@:privateAccess