Skip to content

Wrong name for invalid factory constructor #30999

Open
@scheglov

Description

@scheglov
class A {
  factory B() => null;
}
library;
import self as self;
import "dart:core" as core;

class A extends core::Object {
  static factory B() → self::A
    return null;
}

Looking inside of the generated Kernel Procedure, I see that the name of the factory is set to B, which is incorrect, because if it were A, then the name would have been empty.

image

What I would expect is that an error is reported, and factory B() is parsed as factory A(), and correspondingly factory B.named() as factory A.named().

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestlegacy-area-front-endLegacy: Use area-dart-model instead.model-error-recoveryError recovery in analyzer/CFE.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions