Browse Source

Pass a valid CSharpTypePrinterContext when calling type maps in the C# backend.

pull/1/head
triton 12 years ago
parent
commit
df93d67ecb
  1. 7
      src/Generator/Generators/CSharp/CSharpTypePrinter.cs

7
src/Generator/Generators/CSharp/CSharpTypePrinter.cs

@ -36,6 +36,8 @@ namespace Cxxi.Generators.CSharp
get { return contexts.Peek(); } get { return contexts.Peek(); }
} }
public CSharpTypePrinterContext Context;
public CSharpTypePrinter(ITypeMapDatabase database, Library library) public CSharpTypePrinter(ITypeMapDatabase database, Library library)
{ {
TypeMapDatabase = database; TypeMapDatabase = database;
@ -43,6 +45,8 @@ namespace Cxxi.Generators.CSharp
contexts = new Stack<CSharpTypePrinterContextKind>(); contexts = new Stack<CSharpTypePrinterContextKind>();
PushContext(CSharpTypePrinterContextKind.Managed); PushContext(CSharpTypePrinterContextKind.Managed);
Context = new CSharpTypePrinterContext();
} }
public void PushContext(CSharpTypePrinterContextKind contextKind) public void PushContext(CSharpTypePrinterContextKind contextKind)
@ -169,7 +173,8 @@ namespace Cxxi.Generators.CSharp
{ {
typeMap.Declaration = decl; typeMap.Declaration = decl;
typeMap.Type = template; typeMap.Type = template;
return typeMap.CSharpSignature(new CSharpTypePrinterContext()); Context.Type = template;
return typeMap.CSharpSignature(Context);
} }
return decl.Name; return decl.Name;

Loading…
Cancel
Save