Skip to content

Sema: Fix cycle in structural type resolution via TypeChecker::diagnoseInvalidFunctionType() #41594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

slavapestov
Copy link
Contributor

Fixes rdar://problem/89583624.

…seInvalidFunctionType()

Fixes rdar://problem/89583624.
@slavapestov slavapestov force-pushed the rqm-foreign-function-type-cycle branch from d538b34 to b5fa1ac Compare March 1, 2022 00:18
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit 8adcc2a into swiftlang:main Mar 1, 2022
@convention(c) (UnsafeMutableRawPointer?,
UnsafeMutableRawPointer?,
UnsafeMutableRawPointer?) -> CInt
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the cycle here? Just curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DeclContext::getGenericSignature() => ... => TypeAliasDecl::getStructuralType() => TypeChecker::diagnoseInvalidFunctionType() => TypeBase::isRepresentable() => DeclContext::getGenericSignature()

I could fix isRepresentable() but there's no reason to perform semantic checks in structural mode at all, since we're going to revisit it in interface type mode anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants