1
0
mirror of https://github.com/twiglet/cs2j.git synced 2025-01-18 13:15:17 +01:00

identify typevars in findType. TypeVarRepTemplate derives from ClassRepTemplate so that we don't try to initialise variables of type T

This commit is contained in:
Kevin Glynn 2011-02-18 17:05:00 +01:00
parent 94fa86d57e
commit b6d57d4bd2
2 changed files with 8 additions and 2 deletions

View File

@ -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<TypeVarRepTemplate>
public class TypeVarRepTemplate : ClassRepTemplate, IEquatable<TypeVarRepTemplate>
{
public TypeVarRepTemplate ()

View File

@ -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<TypeRepTemplate> args) {
if (args == null || args.Count == 0) {
return findType(name);
}
StringBuilder argNames = new StringBuilder();
bool first = true;
if (args != null && args.Count > 0) {