Skip to content

Conversation

@siegfriedpammer
Copy link
Member

No description provided.

@siegfriedpammer siegfriedpammer added this to the 3.1 milestone Dec 16, 2017
…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)))
Copy link
Member

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 :)?

Copy link
Member Author

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.

@AraHaan
Copy link

AraHaan commented Dec 29, 2017

@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 backup

to try to fix the merge conflicts, update to latest head of master and then you cherry pick all your commits from her copied to backup back to the remade branch and then force it onto github.
(much cleaner than git merge annoying commits, this is what I now do all the time when stuff like this happens where possible)

@siegfriedpammer siegfriedpammer merged commit 728bc72 into master Jan 25, 2018
@siegfriedpammer siegfriedpammer deleted the string-interpolation branch January 25, 2018 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants