Skip to content

Commit 7fee597

Browse files
committed
[AST] Teach isCGFloatType that CGFloat could also be found in Foundation
1 parent 5e10f08 commit 7fee597

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/AST/Type.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,11 @@ bool TypeBase::isCGFloatType() {
822822
return false;
823823

824824
auto *module = DC->getParentModule();
825-
return module->getName().is("CoreGraphics") && NTD->getName().is("CGFloat");
825+
// on macOS `CGFloat` is part of a `CoreGraphics` module,
826+
// but on Linux it could be found in `Foundation`.
827+
return (module->getName().is("CoreGraphics") ||
828+
module->getName().is("Foundation")) &&
829+
NTD->getName().is("CGFloat");
826830
}
827831

828832
bool TypeBase::isKnownStdlibCollectionType() {

0 commit comments

Comments
 (0)