Repository navigation
nameof fixes - #9498
Merged
Merged
nameof fixes#9498
Conversation
cartermp
reviewed
Jun 18, 2020
| mn 0 xs | ||
| let count pred xs = List.fold (fun n x -> if pred x then n+1 else n) 0 xs | ||
|
|
||
| let headAndTail l = |
Contributor
There was a problem hiding this comment.
This was intentionally removed by @forki in another PR and he cleaned up (and simplified) some places where it was being used. Is it necessary to add back here?
Contributor
Author
There was a problem hiding this comment.
Yeah this is a useful function :-)
|
|
||
| val (|TypeDefOfExpr|_|) : TcGlobals -> Expr -> TType option | ||
|
|
||
| val isNameOfValRef: TcGlobals -> ValRef -> bool |
Contributor
There was a problem hiding this comment.
style nit: this should probably be moved down after all of the active patterns
| let b = nameof(Unchecked.defaultof<BasicNameOfTests>.MemberMethod) | ||
| Assert.AreEqual("MemberMethod", b) | ||
|
|
||
| member this.``can get name of method type parameter``<'TTT> () = |
Contributor
There was a problem hiding this comment.
Should also add this, perhaps as a test in another file
type C<'DootDoot>() =
member _.Name() = nameof<'DootDoot>
TIHan
approved these changes
Jun 18, 2020
Contributor
|
@dsyme what about this? let rec [<Literal>] x = nameof(x) |
KevinRansom
approved these changes
Jun 18, 2020
Contributor
|
The literal business is "resolved" insofar as it requires a langauge suggestion |
nosami
pushed a commit
to xamarin/visualfsharp
that referenced
this pull request
Feb 23, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow
nameof<'T>for name of generic parametersAllow
nameof(Unchecked.defaultof<C>.Property)for instance membersI checked and literals are already allowed:
I think this resolves all issues in the nameof design but @TIHan and @cartermp will check
May require fixing up some tests