This repository was archived by the owner on Dec 19, 2018. It is now read-only.
This repository was archived by the owner on Dec 19, 2018. It is now read-only.
Design Time CodeGen for DirectiveTokenKind.Type doesn't handle value types #1176
Closed
Description
This code in DesignTimeCSharpRenderer
doesn't handle the case where a type used in the directive is a value type:
case DirectiveTokenKind.Type:
Context.AddLineMappingFor(node);
Context.Writer
.Write(node.Content)
.Write(" ")
.WriteStartAssignment(TypeHelper)
.WriteLine("null;");
break;
This will generate code like:
int __typeHelper = null;
We should use default(node.Content)
here.