Skip to content

Commit 24a8153

Browse files
committed
make TypeDecl.name mutable
1 parent 4e8b3ab commit 24a8153

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/main/java/zzzank/probejs/lang/typescript/ScriptDump.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ public void dumpClasses() throws IOException {
213213
val allTypes = new ArrayList<BaseType>();
214214
allTypes.add(thisType);
215215
for (val typeDecl : convertibles.get(classPath)) {
216-
if (typeDecl.symbol != null) {
216+
if (typeDecl.name != null) {
217217
output.addCode(typeDecl);
218-
allTypes.add(Types.primitive(typeDecl.symbol));
218+
allTypes.add(Types.primitive(typeDecl.name));
219219
} else {
220220
allTypes.add(typeDecl.type);
221221
}

src/main/java/zzzank/probejs/lang/typescript/code/member/TypeDecl.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
public class TypeDecl extends CommentableCode {
1919
public boolean exportDecl;
2020

21-
public final String symbol;
21+
public String name;
2222
@NotNull
2323
public List<? extends BaseType> symbolVariables;
2424

@@ -27,23 +27,23 @@ public class TypeDecl extends CommentableCode {
2727
@NotNull
2828
public BaseType.FormatType typeFormat;
2929

30-
public TypeDecl(String symbol, @NotNull BaseType type) {
31-
this(symbol, Collections.emptyList(), type);
30+
public TypeDecl(String name, @NotNull BaseType type) {
31+
this(name, Collections.emptyList(), type);
3232
}
3333

34-
public TypeDecl(String symbol, @NotNull List<? extends BaseType> symbolVariables, @NotNull BaseType type) {
35-
this(true, symbol, symbolVariables, type, BaseType.FormatType.INPUT);
34+
public TypeDecl(String name, @NotNull List<? extends BaseType> symbolVariables, @NotNull BaseType type) {
35+
this(true, name, symbolVariables, type, BaseType.FormatType.INPUT);
3636
}
3737

3838
public TypeDecl(
3939
boolean exportDecl,
40-
String symbol,
40+
String name,
4141
@NotNull List<? extends BaseType> symbolVariables,
4242
@NotNull BaseType type,
4343
@NotNull BaseType.FormatType typeFormat
4444
) {
4545
this.exportDecl = exportDecl;
46-
this.symbol = symbol;
46+
this.name = name;
4747
this.symbolVariables = Asser.tNotNull(symbolVariables, "symbolVariables");
4848
this.type = Asser.tNotNull(type, "type");
4949
this.typeFormat = Asser.tNotNull(typeFormat, "typeFormat");
@@ -65,7 +65,7 @@ public List<String> formatRaw(Declaration declaration) {
6565
if (exportDecl) {
6666
builder.append("export ");
6767
}
68-
builder.append("type ").append(symbol);
68+
builder.append("type ").append(name);
6969
if (!symbolVariables.isEmpty()) {
7070
builder.append(Types.join(", ", "<", ">", symbolVariables)
7171
.line(declaration, BaseType.FormatType.VARIABLE));

0 commit comments

Comments
 (0)