diff --git a/CSharpTranslator/antlr3/src/CS2JTranslator/CS2JTemplate/TranslationTemplate.cs b/CSharpTranslator/antlr3/src/CS2JTranslator/CS2JTemplate/TranslationTemplate.cs index 3040c26..0ecc8fb 100644 --- a/CSharpTranslator/antlr3/src/CS2JTranslator/CS2JTemplate/TranslationTemplate.cs +++ b/CSharpTranslator/antlr3/src/CS2JTranslator/CS2JTemplate/TranslationTemplate.cs @@ -3222,10 +3222,10 @@ namespace Twiglet.CS2J.Translator.TypeRep } [XmlType("TypeVariable")] - // Represents Type Variables. We inherit from StructRepTemplate to that + // Represents Type Variables. We inherit from ClassRepTemplate to that // Type Variables have the same interface as types, but we can override as // neccessary - public class TypeVarRepTemplate : StructRepTemplate, IEquatable + public class TypeVarRepTemplate : ClassRepTemplate, IEquatable { public TypeVarRepTemplate () diff --git a/CSharpTranslator/antlr3/src/CS2JTranslator/CS2JTransform/NetMaker.g b/CSharpTranslator/antlr3/src/CS2JTranslator/CS2JTransform/NetMaker.g index 1d6f61e..b8339c5 100644 --- a/CSharpTranslator/antlr3/src/CS2JTranslator/CS2JTransform/NetMaker.g +++ b/CSharpTranslator/antlr3/src/CS2JTranslator/CS2JTransform/NetMaker.g @@ -96,10 +96,16 @@ scope SymTab { } protected TypeRepTemplate findType(string name) { + if ($NSContext::globalTypeVariables.Contains(name)) { + return new TypeVarRepTemplate(name); + } return AppEnv.Search($NSContext::globalNamespaces, name, new UnknownRepTemplate(name)); } protected TypeRepTemplate findType(string name, ICollection args) { + if (args == null || args.Count == 0) { + return findType(name); + } StringBuilder argNames = new StringBuilder(); bool first = true; if (args != null && args.Count > 0) {