Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2942)

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/UnionTypeImpl.java

Issue 576403002: Make [toString] for union types more user friendly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/UnionTypeImpl.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/UnionTypeImpl.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/UnionTypeImpl.java
index 5970002acf70200514b0baf6099d986360eb75d4..ea282897bb1124ade7a86c22162f3de0b26d989f 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/UnionTypeImpl.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/UnionTypeImpl.java
@@ -94,13 +94,13 @@ public class UnionTypeImpl extends TypeImpl implements UnionType {
@Override
public String getDisplayName() {
StringBuilder builder = new StringBuilder();
- String prefix = "{";
+ String prefix = "(";
for (Type t : types) {
builder.append(prefix);
builder.append(t.getDisplayName());
- prefix = ",";
+ prefix = " or ";
}
- builder.append("}");
+ builder.append(")"); // Suffix.
return builder.toString();
}
@@ -126,13 +126,13 @@ public class UnionTypeImpl extends TypeImpl implements UnionType {
@Override
protected void appendTo(StringBuilder builder) {
- String prefix = "{";
+ String prefix = "(";
for (Type t : types) {
builder.append(prefix);
((TypeImpl) t).appendTo(builder);
- prefix = ",";
+ prefix = " or ";
}
- builder.append("}");
+ builder.append(")");
}
@Override
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698