Skip to content

Commit

Permalink
fix #159, Map field type fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
CheShianHung committed Jan 22, 2018
1 parent 1316b9e commit 1a582b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/java/boa/compiler/visitors/CodeGeneratingVisitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public void visit(final FunctionType n) {

for (final Component c : params) {
args.add(c.getIdentifier().getToken());
types.add(c.getType().type.toJavaType());
types.add(c.getType().type.toInterfaceJavaType());
}

st.add("name", funcType.toJavaType());
Expand Down Expand Up @@ -1583,7 +1583,7 @@ public void visit(final FunctionExpression n) {
if (!(c instanceof BoaName))
continue;
args.add(((BoaName)c).getId());
types.add(((BoaName)c).getType().toJavaType());
types.add(((BoaName)c).getType().toInterfaceJavaType());
}

this.varDecl.start(n);
Expand Down Expand Up @@ -1815,7 +1815,7 @@ public void visit(final FunctionType n) {

for (int i = 0; i < paramTypes.length; i++) {
args.add(((BoaName) paramTypes[i]).getId());
types.add(paramTypes[i].toJavaType());
types.add(paramTypes[i].toInterfaceJavaType());
}

st.add("name", funcType.toJavaType());
Expand Down
8 changes: 7 additions & 1 deletion src/java/boa/types/BoaMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,13 @@ public String toJavaType() {
/** {@inheritDoc} */
@Override
public String toInterfaceJavaType() {
return "java.util.HashMap<" + this.indexType.toParameterJavaType() + ", " + this.valueType.toParameterJavaType() + ">";
return "java.util.Map<" + this.indexType.toParameterJavaType() + ", " + this.valueType.toParameterJavaType() + ">";
}

/** {@inheritDoc} */
@Override
public String toParameterJavaType() {
return "java.util.Map<" + this.indexType.toParameterJavaType() + ", " + this.valueType.toParameterJavaType() + ">";
}

/** {@inheritDoc} */
Expand Down

0 comments on commit 1a582b6

Please sign in to comment.