String typeClassName = args.substring(0, nextSpace);
String instanceTypeString = args.substring(nextSpace).trim();
QualifiedName qualifiedTypeClassName = resolveTypeClassName(typeClassName);
CompilerMessageLogger logger = new MessageLogger();
TypeExpr instanceTypeExpr = getTypeChecker().getTypeFromString(instanceTypeString, targetModule, logger);
if (logger.getNErrors() > 0) {
dumpCompilerMessages(logger);
} else if (qualifiedTypeClassName != null) {
ClassInstanceIdentifier id;
if (instanceTypeExpr instanceof RecordType) {
RecordType recordType = (RecordType)instanceTypeExpr;
if (recordType.isRecordPolymorphic()) {
id = new UniversalRecordInstance(qualifiedTypeClassName);
} else {
throw new IllegalArgumentException();
}
} else if (instanceTypeExpr instanceof TypeConsApp) {
id = new TypeConstructorInstance(qualifiedTypeClassName, ((TypeConsApp)instanceTypeExpr).getName());
} else {
throw new IllegalArgumentException();
}
ModuleTypeInfo typeInfo = workspaceManager.getModuleTypeInfo(targetModule);
if (typeInfo == null) {
iceLogger.log(Level.INFO, "The module " + targetModule + " does not exist.");
} else {
ClassInstance instance = typeInfo.getVisibleClassInstance(id);
if (instance == null) {
iceLogger.log(Level.INFO, "The instance " + id + " does not exist.");
} else {
ScopedEntityNamingPolicy scopedEntityNamingPolicy = new ScopedEntityNamingPolicy.UnqualifiedUnlessAmbiguous(typeInfo);
TypeExpr instanceMethodTypeExpr = instance.getInstanceMethodType(methodName);
iceLogger.log(Level.INFO, methodName + " :: " + instanceMethodTypeExpr.toString(scopedEntityNamingPolicy) + "\n");
ClassMethod classMethod = instance.getTypeClass().getClassMethod(methodName);
try {
CALDocComment comment = instance.getMethodCALDocComment(methodName);