DGen
- VariableParameter's now have their `Type` object extracted and type transformed as part of function definitions. Tests cases - Updated `simple_cast.t` to test new typeTransform() usage on VariableParameter (as stated above)
This commit is contained in:
parent
b1d168ab44
commit
7f8973a4aa
|
@ -597,6 +597,7 @@ public final class DCodeEmitter : CodeEmitter
|
|||
{
|
||||
string signature;
|
||||
|
||||
// Extract the Function's return Type
|
||||
Type returnType = typeChecker.getType(func.context.container, func.getType());
|
||||
|
||||
// <type> <functionName> (
|
||||
|
@ -612,13 +613,16 @@ public final class DCodeEmitter : CodeEmitter
|
|||
{
|
||||
Variable currentParameter = parameters[parIdx];
|
||||
|
||||
// Extract the variable's type
|
||||
Type parameterType = typeChecker.getType(currentParameter.context.container, currentParameter.getType());
|
||||
|
||||
// Generate the symbol-mapped names for the parameters
|
||||
Variable typedEntityVariable = cast(Variable)typeChecker.getResolver().resolveBest(func, currentParameter.getName()); //TODO: Remove `auto`
|
||||
string renamedSymbol = SymbolMapper.symbolLookup(typedEntityVariable);
|
||||
|
||||
|
||||
// Generate <type> <parameter-name (symbol mapped)>
|
||||
parameterString~=currentParameter.getType()~" "~renamedSymbol;
|
||||
parameterString~=typeTransform(parameterType)~" "~renamedSymbol;
|
||||
|
||||
if(parIdx != (parameters.length-1))
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@ module simple_cast;
|
|||
|
||||
int myInt;
|
||||
|
||||
void function()
|
||||
void function(int x)
|
||||
{
|
||||
byte bruh;
|
||||
byte myByte = (cast(byte)myInt)+bruh;
|
||||
|
|
Loading…
Reference in New Issue