-
Notifications
You must be signed in to change notification settings - Fork 3
Array Create results in undefined #8
Copy link
Copy link
Open
Description
When the creating an array in typescript, it looks like the generated code is 'valid' but does not produce the expected results.
Consider the following:
class MyClass{
}
GetOutputType returns "MyClass"
var arrayCreateString = $"{typeString}({sizeEvaluationString})";
say the size is 100
var declareVariable = new CodeVariableDeclarationStatement(typeof(IEnumerable<>).MakeGenericType(new [] { typeof(MyClass) }), "variableName", new CodeArrayCreateExpression(typeof(MyClass)))
expected
var variableName : Array = [];
observed
var variableName : Array = MyClass();
I believe what you were going for is:
var variableName : Array = Array(/size/);
However, from the docs, the CreateType property describes the type stored in the array, not the array's type.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels