constructor.getParameterTypes());
if(dataType.constructors.length == 1 && (
dataType.getTypeDesc() == null ||
- dataType.constructors[0].javaName.equals(MethodBuilderBase.getClassName(dataType.getTypeDesc()))))
+ (dataType.constructors[0].javaName != null &&
+ dataType.constructors[0].javaName.equals(MethodBuilderBase.getClassName(dataType.getTypeDesc())))))
sclConstructor.setOnlyConstructor(true);
value.setValue(sclConstructor);
value.setType(constructor.getType());
typeMap.put(name.name, valueTypeAst);
}
+ THashMap<String, EVar> exportMap = null;
+ if(moduleHeader != null && moduleHeader.export != null) {
+ exportMap = new THashMap<String, EVar>();
+ for(EVar export : moduleHeader.export)
+ if(exportMap.put(export.name, export) != null)
+ errorLog.log(export.location, "The symbol " + export.name + " is exported multiple times.");
+ }
+
for(String name : valueDefinitionsAst.getValueNames()) {
ArrayList<DValueAst> defs = valueDefinitionsAst.getDefinition(name);
try {
for(DAnnotationAst annotation : annotations) {
handleAnnotation(value, defs, annotation);
}
+ if(exportMap != null && exportMap.remove(name) == null)
+ value.addProperty(PrivateProperty.INSTANCE);
} catch(RuntimeException e) {
errorLog.setExceptionPosition(defs.get(0).location);
throw e;
}
}
+ if(exportMap != null)
+ for(EVar export : exportMap.values())
+ errorLog.log(export.location, "The symbol " + export.name + " is not defined in the module.");
for(String name : relationDefinitionsAst.getRelationNames()) {
ArrayList<DRelationAst> definitions = relationDefinitionsAst.getDefinition(name);
if(definitions.size() > 1) {
}
}
else if(annotation.id.text.equals("@private")) {
+ if(moduleHeader != null && moduleHeader.export != null)
+ errorLog.log(annotation.location, "Annotation @private is not used when module header contains export property.");
value.addProperty(PrivateProperty.INSTANCE);
}
else if(annotation.id.text.equals("@deprecated")) {