typeRegistry.declareType("Foo", typeRegistry.createAnonymousObjectType());
typeRegistry.resolveTypesInScope(scope);
assertTrue(functionType.getReturnType().isUnknownType());
assertNull("Unexpected errors: " + reporter.errors(),
reporter.errors());
assertNull("Unexpected warnings: " + reporter.warnings(),
reporter.warnings());
// After incrementing the generation, resolve works again.
typeRegistry.incrementGeneration();