add type variables to SourceMethod

This commit is contained in:
Dave Holoway
2020-06-09 12:51:43 +01:00
parent 252b476147
commit 74a21ecbf8
2 changed files with 79 additions and 49 deletions

View File

@@ -209,6 +209,12 @@ class SourceMethod extends Method {
this._decl = decl;
this._parameters = decl.parameters.map((p,i) => new SourceParameter(p));
this._returnType = new ResolvableType(decl);
this._typevars = decl.typeVariables.map(tv => {
const typevar = new TypeVariable(owner, tv.name);
// automatically add the Object bound
typevar.bounds.push(new TypeVariable.Bound(owner, 'Ljava/lang/Object;', false));
return typevar;
});
}
/**
@@ -221,6 +227,10 @@ class SourceMethod extends Method {
get returnType() {
return this._returnType.resolved;
}
get typeVariables() {
return this._typevars;
}
}
class SourceParameter extends Parameter {