Skip to content

Commit

Permalink
Fix after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
olegshtch committed Jun 11, 2021
1 parent fcfc1f6 commit 085e5b3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ private TsModel addConstructors(SymbolTable symbolTable, TsModel tsModel) {
final List<TsBeanModel> beans = new ArrayList<>();
for (TsBeanModel bean : tsModel.getBeans()) {
final Symbol beanIdentifier = symbolTable.getSymbol(bean.getOrigin());
final List<TsType.GenericVariableType> typeParameters = getTypeParameters(bean.getOrigin());
final List<TsType.BoundedGenericVariableType> typeParameters = getTypeParameters(symbolTable, bean.getOrigin());
final TsType.ReferenceType dataType = typeParameters.isEmpty()
? new TsType.ReferenceType(beanIdentifier)
: new TsType.GenericReferenceType(beanIdentifier, typeParameters);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@

public class TsAliasModel extends TsDeclarationModel {

private final List<TsType.GenericVariableType> typeParameters;
private final List<? extends TsType.GenericVariableType> typeParameters;
private final TsType definition;

public TsAliasModel(Class<?> origin, Symbol name, List<TsType.GenericVariableType> typeParameters, TsType definition, List<String> comments) {
public TsAliasModel(Class<?> origin, Symbol name, List<? extends TsType.GenericVariableType> typeParameters, TsType definition, List<String> comments) {
super(origin, null, name, comments);
this.typeParameters = typeParameters != null ? typeParameters : Collections.emptyList();
this.definition = definition;
}

public List<TsType.GenericVariableType> getTypeParameters() {
public List<? extends TsType.GenericVariableType> getTypeParameters() {
return typeParameters;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class KotlinTest {
val settings = TestUtils.settings()
val output = TypeScriptGenerator(settings).generateTypeScript(Input.from(A2::class.java))
val errorMessage = "Unexpected output: $output"
Assert.assertTrue(errorMessage, output.contains("interface A2<S>"))
Assert.assertTrue(errorMessage, output.contains("interface A2<S extends Enum<S>>"))
}

private class A2<S> where S : Enum<S> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public void testWithTypeParameter() {
final Settings settings = TestUtils.settings();
final String output = new TypeScriptGenerator(settings).generateTypeScript(Input.from(Earth.class));
Assert.assertTrue(output.contains("EngineUnion"));
Assert.assertTrue(output.contains("VehiculeUnion<M>"));
Assert.assertTrue(output.contains("VehiculeUnion<M extends Engine>"));
}

public static void main(String[] args) throws Exception {
Expand Down

0 comments on commit 085e5b3

Please sign in to comment.