Skip to content
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
rynowak opened this issue Apr 4, 2017 · 2 comments
Closed

Comments

@rynowak
Copy link
Member

rynowak commented Apr 4, 2017

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.

@rynowak
Copy link
Member Author

rynowak commented May 16, 2017

Consider this part of the 15.3 release

NTaylorMullen added a commit that referenced this issue May 17, 2017
- Instead of rendering a null assigning statement for a type token we now render a `default(TTypeToken)`. With this approach type tokens can be value types without creating a design time error.
- Re-generated baseline files to reflect new directive token code generation.

#1176
NTaylorMullen added a commit that referenced this issue May 17, 2017
- Instead of rendering a null assigning statement for a type token we now render a `default(TTypeToken)`. With this approach type tokens can be value types without creating a design time error.
- Re-generated baseline files to reflect new directive token code generation.

#1176
NTaylorMullen added a commit that referenced this issue May 17, 2017
- Instead of rendering a null assigning statement for a type token we now render a `default(TTypeToken)`. With this approach type tokens can be value types without creating a design time error.
- Re-generated baseline files to reflect new directive token code generation.

#1176
@NTaylorMullen
Copy link
Contributor

b8ea008

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants