Skip to content

Implement correct parametrized types for factories #417

Closed
@ghost

Description

This test crashes in debug mode:
./vm/ast.h:1689: error: expected: type_arguments_.IsNull() || (type_arguments_.Length() == Class::Handle(constructor_.owner()).NumTypeArguments())

Once the crash is analyzed and eliminated, feel free to lower this issues's priority.


FactoryNegativeTest.dart:

main() {
  // Compile time error, wrong factory method.
  var a = new Link<int>.create();
}

interface Link<T> factory LinkFactory {
  Link.create();
}

class LinkFactory {
  // Compile time error: should be Link<T>.create().
  factory Link.create() {
    return null;
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1A high priority bug; for example, a single project is unusable or has many test failures

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions