-
-
Couldn't load subscription status.
- Fork 3.6k
C# 6 String interpolation #1012
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
Conversation
…ts use string literals, nested string literals are not allowed.
| case "System.String.Format": | ||
| if (context.Settings.StringInterpolation && arguments.Length > 1 | ||
| && arguments[0] is PrimitiveExpression stringExpression && stringExpression.Value is string | ||
| && arguments.Skip(1).All(a => !a.DescendantsAndSelf.OfType<PrimitiveExpression>().Any(p => p.Value is string))) |
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.
You only check for normal string literals.
Formatted string literals are probably also forbidden?
What about char literals?
What about the ?: operator (might be problematic due to having a :)?
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 just tested with char literals and interpolated strings... seems fine to use them.
As for conditional expressions: seems they're only valid when wrapped in parentheses.
|
@siegfriedpammer you might want to: git branch backup
git checkout master
git branch -D string-interpolation
git branch string-interpolation
git checkout string-interpolation
git cherry-pick backupto try to fix the merge conflicts, update to latest head of master and then you cherry pick all your commits from her copied to |
…olation literals.
…erpolation # Conflicts: # ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
9e95568 to
fdb1991
Compare
No description provided.