Skip to content

Named optional parameter can begin with an underscore #434

Closed
@DartBot

Description

@DartBot

This issue was originally filed by alexei.kaigo...@gmail.com


Dart Language specification reads:
6.2.2 Named Optional Formals
 It is a compile-time error if the name of a named optional parameter begins with an _ character.

However, dart_bin reports no error in such cases.

What steps will reproduce the problem?

  1. create test file:
    main() {
      void func([var _x]) {}
    }
  2. run it with dart/out/Debug_ia32/dart_bin
  3. check returned error code

What is the expected output? What do you see instead?
compiler error expected, but no error reported

What version of the product are you using? On what operating system?
dart svn revision 1499, on Linux

Please provide any additional information below.:

This error causes failure of the test
co19/LangSpecTest/06_Functions/06_2_Formal_Parameters/06_2_2_Named_Optional_Formals/A03/t01

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions