Skip to content

Revert "Merge pull request #81840 from compnerd/aliases" #82207

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

Closed
wants to merge 1 commit into from

Conversation

MaxDesiatov
Copy link
Contributor

@MaxDesiatov MaxDesiatov commented Jun 12, 2025

This reverts commit 33a324e, reversing changes made to 0afeafa due to a regression:

$ printf "import var Darwin.stderr\n" | /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swiftc -typecheck - -sdk $(xcrun --show-sdk-path)
<stdin>:1:12: error: ambiguous name 'stderr' in module 'Darwin'
1 | import var Darwin.stderr
  |            `- error: ambiguous name 'stderr' in module 'Darwin'
2 |

_stdio.stderr:2:12: note: found this candidate
1 | @available(macOS 10.9, iOS 7.0, watchOS 2.0, tvOS 9.0, visionOS 1.0, *)
2 | public var stderr: UnsafeMutablePointer<FILE> { get set }
  |            `- note: found this candidate

_stdio.stderr:1:12: note: found this candidate
1 | public var stderr: UnsafeMutablePointer<FILE> { get set }
  |            `- note: found this candidate
# Conflicts:
#	test/ClangImporter/Inputs/custom-modules/module.modulemap

This reverts commit 33a324e, reversing
changes made to 0afeafa due to a regression:

```
$ printf "import var Darwin.stderr\n" | /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swiftc -typecheck - -sdk $(xcrun --show-sdk-path)
<stdin>:1:12: error: ambiguous name 'stderr' in module 'Darwin'
1 | import var Darwin.stderr
  |            `- error: ambiguous name 'stderr' in module 'Darwin'
2 |

_stdio.stderr:2:12: note: found this candidate
1 | @available(macOS 10.9, iOS 7.0, watchOS 2.0, tvOS 9.0, visionOS 1.0, *)
2 | public var stderr: UnsafeMutablePointer<FILE> { get set }
  |            `- note: found this candidate

_stdio.stderr:1:12: note: found this candidate
1 | public var stderr: UnsafeMutablePointer<FILE> { get set }
  |            `- note: found this candidate
```

# Conflicts:
#	test/ClangImporter/Inputs/custom-modules/module.modulemap
@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

@MaxDesiatov MaxDesiatov requested a review from al45tair June 12, 2025 14:36
@MaxDesiatov MaxDesiatov added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. clang importer Area → compiler: The clang importer labels Jun 12, 2025
@compnerd
Copy link
Member

I’m going to just add an exclusion for Darwin, there’s no good fix here that I can do - this requires changing the Darwin overlays.

@compnerd
Copy link
Member

I wonder if @hnrklssn has any suggestions to avoid the exclusion of the Darwin module.

@compnerd
Copy link
Member

#82213 should at least get this workarounded

@al45tair
Copy link
Contributor

Let's do #82213 if we can, and then worry about fixing that later, rather than reverting everything.

@MaxDesiatov MaxDesiatov deleted the maxd/revert-clangimporter-regression branch June 13, 2025 08:33
@hnrklssn
Copy link
Contributor

I wonder if @hnrklssn has any suggestions to avoid the exclusion of the Darwin module.

The only thing I can think of would be if @_disfavoredOverload works for variables, but it's a bit of an ugly hack, so if those 3 defines in stdio are the only ones we have to special-case to make this work, I'd rather temporarily do that until Darwin is updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. clang importer Area → compiler: The clang importer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants