private FunctionType getOrCreateInterface() { FunctionType fnType = null; JSType type = typeRegistry.getType(getScopeDeclaredIn(), fnName); if (type != null && type.isInstanceType()) { FunctionType ctor = type.toMaybeObjectType().getConstructor(); if (ctor.isInterface()) { fnType = ctor; fnType.setSource(contents.getSourceNode()); } } if (fnType == null) { fnType = typeRegistry.createInterfaceType( fnName, contents.getSourceNode(), templateTypeNames, makesStructs); if (!fnName.isEmpty()) { typeRegistry.declareTypeForExactScope( getScopeDeclaredIn(), fnName, fnType.getInstanceType()); } maybeSetBaseType(fnType); } return fnType; } private void reportWarning(DiagnosticType warning, String ... args) {
fnType = getOrCreateConstructor(); } else if (isInterface) { fnType = typeRegistry.createInterfaceType( fnName, contents.getSourceNode(), classTemplateTypeNames, makesStructs); if (getScopeDeclaredIn().isGlobal() && !fnName.isEmpty()) {