Granular type information for properties
This commit is contained in:
@@ -16,8 +16,27 @@ public class DescriptorUtil {
|
|||||||
new DeclarationDescriptorVisitor<Void, StringBuilder>() {
|
new DeclarationDescriptorVisitor<Void, StringBuilder>() {
|
||||||
@Override
|
@Override
|
||||||
public Void visitPropertyDescriptor(PropertyDescriptor descriptor, StringBuilder builder) {
|
public Void visitPropertyDescriptor(PropertyDescriptor descriptor, StringBuilder builder) {
|
||||||
JetType type = descriptor.getOutType();
|
JetType outType = descriptor.getOutType();
|
||||||
builder.append(renderName(descriptor)).append(" : ").append(type);
|
JetType inType = descriptor.getInType();
|
||||||
|
String typeString = "<no type>";
|
||||||
|
if (inType != null && outType != null) {
|
||||||
|
builder.append("var ");
|
||||||
|
if (inType.equals(outType)) {
|
||||||
|
typeString = outType.toString();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
typeString = "<in " + inType + " out " + outType + ">";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (outType != null) {
|
||||||
|
builder.append("val ");
|
||||||
|
typeString = outType.toString();
|
||||||
|
}
|
||||||
|
else if (inType != null) {
|
||||||
|
builder.append("<write-only> ");
|
||||||
|
typeString = inType.toString();
|
||||||
|
}
|
||||||
|
builder.append(renderName(descriptor)).append(" : ").append(typeString);
|
||||||
return super.visitPropertyDescriptor(descriptor, builder);
|
return super.visitPropertyDescriptor(descriptor, builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user