Fix curly brace and interpolated string#57751
Conversation
|
@bernd5 We've discussed this and are going to take this change. |
|
We probably need to document a breaking change in https://github.com/dotnet/roslyn/blob/main/docs/compilers/CSharp/Compiler%20Breaking%20Changes%20-%20DotNet%207.md |
|
@dotnet/roslyn-compiler For eyes on this. LDM approved us changing the behavior here as this is the behavior the runtime already changed to in .net core3.0. This is now an impact when we emit interpolated string handlers. |
|
@jcouv Agreed. Does that go in with the PR, or is it a separate process? |
With this PR |
333fred
left a comment
There was a problem hiding this comment.
Compiler changes LGTM (commit 13)
|
Hopefully final question is: do we need to make a change in VB parsing as well? |
|
My feeling is that vb is likely fine. Since it doesn't support interpolated string handlers right? So it will still emit string. Format and will be ok. |
It doesn't, but it will still parse differently, right? If we're ok with that, then ok. Just wanted a check on whether we think that parsing difference is ok. |
|
@bernd5 looks like there's a couple of nullable issues:
|
|
Yes Cyrus removed #nullable disable. |
|
Sorry, will fix. |
…com/bernd5/roslyn into fix_CurlyBraceAndInterpolatedString
Before I sign off I'd like @AlekseyTs's thoughts on this as well. Note that this won't change runtime semantics, only the parse tree. |
|
In my eyes VB should be changed, too. But in a separate PR. |
…com/bernd5/roslyn into fix_CurlyBraceAndInterpolatedString
…rpolatedString # Conflicts: # src/Compilers/CSharp/Portable/Parser/Lexer_StringLiteral.cs
|
I spoke with @AlekseyTs offline about this. We're fine with not changing VB in this PR, and I filed #58043 as a help-wanted issue if someone wants to correct VB parsing in the future. |
333fred
left a comment
There was a problem hiding this comment.
LGTM (commit 33). @dotnet/roslyn-compiler for a second review.
|
@RikkiGibson can you look at this community PR as well? It will impact the raw-string-literal work as well, so it would be good to have your eyes on it. |
|
@RikkiGibson @chsienki can you ptal here? thanks! |
| } | ||
| }"; | ||
| CreateCompilationWithMscorlib45(source).VerifyDiagnostics( | ||
| // (6,33): error CS1056: Unerwartetes Zeichen "{". |
There was a problem hiding this comment.
Nit: should this be English to be consistent?
(Although I quite like the idea of having different languages in the code base 😊)
|
THanks @bernd5 ! I'll make sure the raw-string-literals work picks this up as well. |
fixes: #57750