specialise methods with type variables

This commit is contained in:
Dave Holoway
2020-06-10 11:57:16 +01:00
parent 41adfbe53e
commit 309cc47107
2 changed files with 14 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
const { JavaType, CEIType, PrimitiveType, Constructor, Method, MethodBase, Field, Parameter, TypeVariable, UnresolvedType, signatureToType } = require('java-mti');
const { JavaType, ArrayType, CEIType, NullType, PrimitiveType, TypeVariableType, Constructor, Method, MethodBase, Field, Parameter, TypeVariable, UnresolvedType, signatureToType } = require('java-mti');
const { ModuleBlock, TypeDeclBlock, FieldBlock, ConstructorBlock, MethodBlock, InitialiserBlock, ParameterBlock, TextBlock } = require('./parser9');
/**
@@ -214,6 +214,7 @@ class SourceMethod extends Method {
this._decl = decl;
this._parameters = decl.parameters.map((p,i) => new SourceParameter(p));
this._returnType = new ResolvableType(decl);
/** @type {TypeVariable[]} */
this._typevars = decl.typeVariables.map(tv => {
const typevar = new TypeVariable(owner, tv.name);
// automatically add the Object bound