Skip to content
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

Prefixed module nameof #16743

Merged
merged 5 commits into from
Feb 22, 2024
Merged

Prefixed module nameof #16743

merged 5 commits into from
Feb 22, 2024

Conversation

nojaf
Copy link
Contributor

@nojaf nojaf commented Feb 21, 2024

Description

This is a slight variation on #16550

Checklist

  • Test cases added

  • Performance benchmarks added in case of performance changes

  • Release notes entry updated:

    Please make sure to add an entry with short succinct description of the change as well as link to this pull request to the respective release notes file, if applicable.

    Release notes files:

    • If anything under src/Compiler has been changed, please make sure to make an entry in docs/release-notes/.FSharp.Compiler.Service/<version>.md, where <version> is usually "highest" one, e.g. 42.8.200
    • If language feature was added (i.e. LanguageFeatures.fsi was changed), please add it to docs/releae-notes/.Language/preview.md
    • If a change to FSharp.Core was made, please make sure to edit docs/release-notes/.FSharp.Core/<version>.md where version is "highest" one, e.g. 8.0.200.

    Information about the release notes entries format can be found in the documentation.
    Example:

    If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request.

@nojaf nojaf requested a review from a team as a code owner February 21, 2024 14:38
Copy link
Contributor

github-actions bot commented Feb 21, 2024

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/8.0.300.md

@psfinaki psfinaki merged commit 57098f6 into dotnet:main Feb 22, 2024
29 checks passed
@nojaf
Copy link
Contributor Author

nojaf commented Feb 22, 2024

Hi @vzarytovskii, if possible could you do the backport thing? Would be nice if this makes it into a patch release.

@vzarytovskii
Copy link
Member

Hi @vzarytovskii, if possible could you do the backport thing? Would be nice if this makes it into a patch release.

Which version? 20x?

@nojaf
Copy link
Contributor Author

nojaf commented Feb 22, 2024

Yeah, whatever ships before 8.0.300.

@vzarytovskii
Copy link
Member

/backport to release/dev17.9

Copy link
Contributor

Started backporting to release/dev17.9: https://github.com/dotnet/fsharp/actions/runs/8006597118

Copy link
Contributor

@vzarytovskii backporting to release/dev17.9 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Consider prefixed module name in nameof expression.
Applying: Consider prefixed module name in nameof pattern.
Applying: Remove foo
Applying: Update release notes
Using index info to reconstruct a base tree...
A	docs/release-notes/.FSharp.Compiler.Service/8.0.300.md
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): docs/release-notes/.FSharp.Compiler.Service/8.0.300.md deleted in HEAD and modified in Update release notes. Version Update release notes of docs/release-notes/.FSharp.Compiler.Service/8.0.300.md left in tree.
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0004 Update release notes
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

Copy link
Contributor

@vzarytovskii an error occurred while backporting to release/dev17.9, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

@vzarytovskii
Copy link
Member

@nojaf auto-merge failed, could you please cherry-pick it and PR to 17.9?

nojaf added a commit to nojaf/fsharp that referenced this pull request Feb 22, 2024
* Consider prefixed module name in nameof expression.

* Consider prefixed module name in nameof pattern.

* Remove foo

* Update release notes

* Update src/Compiler/Driver/GraphChecking/FileContentMapping.fs

Co-authored-by: dawe <dawedawe@posteo.de>

---------

Co-authored-by: dawe <dawedawe@posteo.de>
nojaf added a commit to nojaf/fsharp that referenced this pull request Feb 22, 2024
* Consider prefixed module name in nameof expression.

* Consider prefixed module name in nameof pattern.

* Remove foo

* Update release notes

* Update src/Compiler/Driver/GraphChecking/FileContentMapping.fs

Co-authored-by: dawe <dawedawe@posteo.de>

---------

Co-authored-by: dawe <dawedawe@posteo.de>
@nojaf nojaf mentioned this pull request Feb 22, 2024
3 tasks
vzarytovskii pushed a commit that referenced this pull request Feb 24, 2024
Comment on lines +342 to +343
| SynExpr.Ident moduleNameIdent -> Some(NameofResult.SingleIdent moduleNameIdent)
| SynExpr.LongIdent(longDotId = longIdent) ->
Copy link
Member

Choose a reason for hiding this comment

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

@nojaf I think this may require more cases that can be parsed here and where a module name is allowed. For example, consider this:

nameof GenericType<Module.TypeInsideModule>

Maybe I'm missing something, but I thought this would be covered by a separate case in SynExpr.
If that's correct, I'd suggest going through all of its cases and checking what is allowed in nameof.

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

Successfully merging this pull request may close these issues.

5 participants