Repository navigation
Fix single quote and space in F# pretty methods - #4969
Conversation
commented
Apr 9, 2024
|
We don't check for any additional characters in to unparse the method name from CIL, so Leaving this for another issue, if someone can confirm this is causing problems, or confirm what are the exact rules that F# uses to escape those names. |
commented
Apr 9, 2024
|
I have run a few manual tests and here are the characters that gets transformed (not exhaustive list):
I will look at more cases now. |
commented
Apr 9, 2024
|
Moved the issue here: #4972 because this PR solves the part where discovery cannot finish. With this fix it produces a managed name, but still not a managed name that can be used to lookup the method by name via reflection, which is a different problem with a bigger scope. |
|
FYI, found the exact grammar for it: token ident =
| ident-text For example, myName1
| `` ( [^'`' '\n' '\r' '\t'] | '`' [^ '`' '\n' '\r' '\t'] )+ ``I can find exact escaping rules if you'll remind me tomorrow :) |
Description
Whitespace is not valid in method names and the parser was not skipping over escaped single tick
\', so the method name from F#``don't pass``would be output as'don\'t pass'in CIL. And the parser would parse'don\'as being quoted, andt passas invalid method part because there is whitespace.Related issue
Fix #4313