Skip to content

Commit

Permalink
Test for unresolved generics
Browse files Browse the repository at this point in the history
Testcase from #380
  • Loading branch information
Oleg Schelykalnov committed Sep 3, 2019
1 parent e55f298 commit 837f0c0
Showing 1 changed file with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,41 @@ class Page2 {
class TableGA<T> {
public T[] rows;
}

interface ExecutionResult {
public <T extends Number> T getData();
}

@Test
public void testResolveParameter() {
final Settings settings = TestUtils.settings();
final String output = new TypeScriptGenerator(settings).generateTypeScript(Input.from(Entity1View.class));
final String nl = settings.newline;
final String expected =
"interface Entity1View extends Entity1IdView {" + nl +
" name: string;" + nl +
"}" + nl +
nl +
"interface Entity1IdView extends IdView<string> {" + nl +
"}" + nl +
nl +
"interface IdView<T extends string> {" + nl +
" id: T;" + nl +
"}";
assertEquals(expected, output.trim());
}

public interface IdView<T extends String> {
T getId();
}

public interface Entity1IdView extends IdView<String> {
}

public abstract class Entity1View implements Entity1IdView {
private String name;

public String getName() { return name; }
}

}

0 comments on commit 837f0c0

Please sign in to comment.