-
Notifications
You must be signed in to change notification settings - Fork 789
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
Teach the compiler how to discover more kinds of parameter names #10810
Teach the compiler how to discover more kinds of parameter names #10810
Conversation
I pushed a different approach to discovering argument names for LongIdent patterns that doesn't seem to change as much of the processing logic. Instead of changing how the simple pat |
Nice! closely related to an issue I opened a month ago #10514 |
@NinoFloris excellent! Glad to get more pointers as to where I should be looking. As we can see from the sea of red |
83cacd0
to
57787ee
Compare
@baronfel you can add a few tests here: https://github.com/dotnet/fsharp/blob/main/tests/FSharp.Compiler.ComponentTests/Language/XmlComments.fs there should be an option to explicitly expect no diagnostics, which would accomplish the goal |
Thanks, done! |
I'm wondering if my constructor fix should even go in, because from this preexisting test it seems like the intended design was to require explicit documentation of the implicit constructor, which was a thing I didn't know was possible. |
Hmmm. Yeah, that just sounds like a weird quirk to me. The large majority of class declarations use primary constructors on the same line and they should just also be checked as-is. |
These commits enable the following script to compile using the locally-built fsi and the
--warnon:3900
flag without warning about missing parameters, fixing #10809:The first commit expands the set of type constructors that
TcTyconDefnCore_Phase1A_BuildInitialTycon
knows how to extract pattern names for to includeTyconUnspecified
, because that's what came through when debugging the above script. I am unsure if this is the correct Tycon to be looking for here, but the overall pattern traversal to extract names seems easy enough.The second commit is a bit more ambiguous to me. I've changed the way
SynValData
is inferred for bindings (specifically the constructor of aSynSimplePat
from aSynPat
) so that aParen(LongIdent(pat))
can be constructed. That is, applications like(Thing.Inner s)
will return a simple pat with the name of the inner application, in this cases
. I am unsure if this is a) correct, and b) safe because I recognize that applying a LongIdent to the incoming value in this case is like sayinglet (Thing.Inner s) = anon_incoming_value
and returning the inner s, but I'm trying to strike a balance between the usability of the doc-checking feature and the correctness of my change.Finally, I'm unsure where tests for these sorts of changes should go and would appreciate any pointers in that direction.