Skip to content

IntelliJ missing comma causes code below it to be marked as dead instead of warning about missing comma #31617

Open
@devoncarew

Description

@devoncarew

From @ScottS2017 on December 11, 2017 19:29

Some other unexpected behavior from IntelliJ. One would expect it to warn about a missing comma, the same way we're warned about a missing ; ] or }. However, instead of that, it just marks all code below that point as "dead code" and turns it gray. As you know, dead code also has tips disabled, which doesn't help matters.

Since I was getting warnings for missing ; ] and } I assumed that I wasn't missing anything since I wasn't getting a similar warning. Therefore, I chased my tail for hours trying to figure out what was wrong with other things in the code. Here is an example of code that this actually happened on, with the text changed for simplicity:

body: new Container(
        child: new Center(
          child: new Column(
            children: <Widget>[
              new Text("Placeholder Text") //Missed a comma here, 
                                            //all code below here
                                           // is gray "dead code"
              new RaisedButton(child: new Text("Press me!"))
            ],
          ),
        ),
      ),

Copied from original issue: flutter/flutter#13485

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestanalyzer-recoveryarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.model-error-recoveryError recovery in analyzer/CFE.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions