Skip to content

Allow module aliases to be raw identifiers. #1836

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
merged 1 commit into from
Mar 24, 2025

Conversation

allevato
Copy link
Member

@allevato allevato commented Mar 12, 2025

This is the companion to the frontend changes for SE-0451 in swiftlang/swift#76636. The first component of a -module-alias flag is allowed to be a raw identifier (without the backticks); for example, -module-alias //some/module:name=ActualModuleName allows users to write this:

import `//some/module:name`

The target of the alias (the actual module name) must still be a valid Swift identifier, since that corresponds to file system artifacts that need stricter naming conventions.

This is the companion to the frontend changes for SE-0451 in
swiftlang/swift#76636. The first component
of a `-module-alias` flag is allowed to be a raw identifier (without
the backticks), which allows for uses like the following:

```
import `//some/module:name`
```

The *target* of the alias (the actual module name) must still be a
valid Swift identifier, since that corresponds to file system
artifacts that need stricter naming conventions.
@allevato
Copy link
Member Author

@swift-ci please test

@rauhul
Copy link
Member

rauhul commented Mar 12, 2025

Oh this will be so much nicer for bazel projects! ❤️

@allevato
Copy link
Member Author

@swift-ci please test

@allevato allevato enabled auto-merge March 24, 2025 14:16
@allevato allevato merged commit 3668c9f into swiftlang:main Mar 24, 2025
3 checks passed
@allevato allevato deleted the module-alias-raw-identifiers branch March 24, 2025 18:58
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.

3 participants