Skip to content

Conversation

@slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Nov 18, 2025

We cannot use 'static' linkage for something that points into the ASTContext, because there might be more than one ASTContext in a single process.

Also, fix the spelling mistake in a related function name.

Finally, LinkEntity::Kind::DifferentiabilityWitness was in the wrong place. It's not a type kind. Move it to avoid UB when calling isTypeKind().

@slavapestov slavapestov requested review from compnerd and removed request for rjmccall November 18, 2025 15:18
@slavapestov slavapestov force-pushed the fix-ridiculous-irgen-thing branch from fba174a to b2c9b4a Compare November 18, 2025 17:18
As the above comments imply, when isTypeKind() returns true, then
getType() should return a valid Type. This wasn't true with
DifferentiabilityWitness.
We cannot use 'static' linkage for something that points into the
ASTContext, because there might be more than one ASTContext in a
single process.

Also, fix the spelling mistake in a related function name.
@slavapestov slavapestov force-pushed the fix-ridiculous-irgen-thing branch from b2c9b4a to ca0f310 Compare November 19, 2025 15:19
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test macOS

@slavapestov slavapestov merged commit bfb6c82 into swiftlang:main Nov 20, 2025
3 checks passed
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