Skip to content

Analyzer's ConstructorDeclaration.redirectedConstructor.name is null on unresolved elements #60120

Open
@rrousselGit

Description

@rrousselGit

Consider:

class Example {
  factory Example() = Redirect.myName;
}

Then analyzed using analyzer 7.3.0

In that case, ConstructorDeclaration.redirectedConstructor is non-null, yet .redirectedConstructor.name and .period are both null.
I would expect it to point to myName.


This appears to be specific to when the redirected class doesn't exist. In that example, Redirect isn't a thing.
If we create the Redirect class, the issue disappears.

But in my case, I am writing a code-generator, and Redirect is what I'm going to generate. Hence, it doesn't exist yet but will soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onanalyzer-apiIssues that impact the public API of the analyzer packagearea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.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