Removing Activator.CreateInstance call from CodeTreeBuilder

This commit is contained in:
Pranav K 2014-09-08 14:42:59 -07:00
parent 489caed17c
commit 658eed4c0f
1 changed files with 3 additions and 3 deletions

View File

@ -125,14 +125,14 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler
}, association, topLevel: true);
}
public T StartChunkBlock<T>(SyntaxTreeNode association) where T : ChunkBlock
public T StartChunkBlock<T>(SyntaxTreeNode association) where T : ChunkBlock, new()
{
return StartChunkBlock<T>(association, topLevel: false);
}
public T StartChunkBlock<T>(SyntaxTreeNode association, bool topLevel) where T : ChunkBlock
public T StartChunkBlock<T>(SyntaxTreeNode association, bool topLevel) where T : ChunkBlock, new()
{
T chunk = (T)Activator.CreateInstance(typeof(T));
var chunk = new T();
AddChunk(chunk, association, topLevel);