Skip to content

ConstructorNamedTest fails on dartc: should have run-time error #1872

Closed
@DartBot

Description

@DartBot

This issue was originally filed by zundel@google.com


Currently, dartc treats this problem as a warning:

class X {
  X([a='arg1',b='arg2']) { }
}

main() {
  var x = new X('foo', a: 'bar');
}

WARNING:STATIC_TYPE:DUPLICATE_NAMED_ARGUMENT:file:/tmp/t.dart/t.dart:7:24:8: Named parameter argument already provided as positional argument
     6: main() {
     7: var x = new X('foo', a: 'bar');

10.13.2 has non-normative text about the issue saying it 'may not repeat' arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions