-
Notifications
You must be signed in to change notification settings - Fork 783
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
Langversion for nameof feature #7125
Langversion for nameof feature #7125
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question, but otherwise this looks great!
@@ -0,0 +1,404 @@ | |||
//<Expects id="FS0039" status="error" span="(100,17)">The value or constructor 'nameof' is not defined.</Expects> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the error be "nameof requires /langversion:4.7
or greater?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the original error message in older versions of the compiler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need be this strict, but I'll leave it up to you and @cartermp. It feels like if we can program a better user experience easily we should.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dsyme, I agree, that we can improve things as we move forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have been covered in the LangVersion RFC, but we need to emit a diagnostic about it not being available in the user's current LangVersion.
Here are the failures I spotted, though I don't understand how they are related to the PR
|
src/fsharp/NameResolution.fs
Outdated
@@ -2475,7 +2476,15 @@ let rec ResolveExprLongIdentPrim sink (ncenv: NameResolver) first fullyQualified | |||
| Exception e -> typeError := Some e; None | |||
|
|||
| true, res -> | |||
Some (FreshenUnqualifiedItem ncenv m res, []) | |||
let fresh = FreshenUnqualifiedItem ncenv m res, [] | |||
match fresh |> fst with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explicit calls to fst
are not normally used if there is a chance to use a tuple pattern instead. S try
let (item, _) as fresh = FreshenUnqualifiedItem ncenv m res, []
match item with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will look at the failures today, I have no idea why they occur.
OK this is ready now - @cartermp or @KevinRansom if you merge please it will unblock similar for #6806 and #6807 |
thx |
@dsyme can you check this out pls.