Skip to content

Bad tokenization of C# nullable types #1290

Closed

Description

@mihaipopescu

Expected versus output diff:

diff --git "a/C:\\work\\external\\uncrustify\\tests\\output\\staging\\60033-UNI-21730.cs" "b/C:\\work\\external\\uncrustify\\tests\\results\\staging\\60033-UNI-21730.cs"
index 3dc1784..299de85 100644
--- "a/C:\\work\\external\\uncrustify\\tests\\output\\staging\\60033-UNI-21730.cs"
+++ "b/C:\\work\\external\\uncrustify\\tests\\results\\staging\\60033-UNI-21730.cs"
@@ -1,5 +1,5 @@
 private void Foo()
 {
-    Action<UnityPlayerBaseStartInfo, GraphicsTestRunConfiguration, Action<string, Bitmap, long>, RenderingBackend, DX11FeatureLevel? , string> playerRunnerImageCallback
+    Action<UnityPlayerBaseStartInfo, GraphicsTestRunConfiguration, Action<string, Bitmap, long>, RenderingBackend, DX11FeatureLevel ? , string> playerRunnerImageCallback
         = (playerStartInfo, description, incomingScreenshotCallback, configuration, dx11Featurelevel, graphicsDriverType) => incomingScreenshotCallback(filename, new Bitmap(1, 1), 42);
 }

Debug support files:

60033-UNI-21730.cs
60033-UNI-21730.cs.log
60033-UNI-21730.cs.unc
Uncrustify.CSharp.cfg
UNI-21730.cs

Disclaimer:

Note: This is a generated issue from our internal issue tracker.
Expect a dry description which could be insufficient to properly understand the issue.
On the other hand, the support files should be sufficient to easily reproduce and debug the issue,
but please comment if it's still unclear and I will get back with clarifications.
See main discussion thread here #1223.

Activity

  1. brendanlong commented on Jul 23, 2017

    @brendanlong
    Contributor

    I'm having the same problem in Vala, and there doesn't seem to be any option which convinces it to put the ? with the nullable type, without also removing space around the ternary operator.

  2. spuppala-rythmos commented on Dec 26, 2017

    @spuppala-rythmos

    In unity fork this issue is fixed with Down-merge PR
    Unity-Technologies#48

  3. gmaurel commented on Jan 24, 2018

    @gmaurel
    Collaborator

    Fixed at e0f021a, Jan 6 18:07:41 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions