Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dartium library uses _ as first character in some named argument parameter names #3496

Closed
DartBot opened this issue Jun 11, 2012 · 10 comments
Closed
Assignees

Comments

@DartBot
Copy link

DartBot commented Jun 11, 2012

This issue was originally filed by zundel@google.com


Ran into this problem when adding the check specified in spec v 0.10 section 6.2:

"It is a compile-time error if the name of a named optional parameter begins with an character."

ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40520|3|78|Named parameters cannot start with an '_' character
 40519: _F64(buffer, byteOffset, length);
 40520: static _F64(_arg0, [_arg1, _arg2]) native "Float64Array_constructor_Callback";
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@DartBot
Copy link
Author

DartBot commented Jun 12, 2012

This comment was originally written by zundel@google.com


There are multiple methods causing this problem, here is the full output

stderr:
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40513|23|5|Named parameters cannot start with an '_' character
 40512: _F32(buffer, byteOffset, length);
 40513: static _F32(_arg0, [_arg1, arg2]) native "Float32Array_constructor_Callback";
                              ~~~~~
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40513|30|5|Named parameters cannot start with an '
' character
 40512: _F32(buffer, byteOffset, length);
 40513: static _F32(_arg0, [_arg1, arg2]) native "Float32Array_constructor_Callback";
                                     ~~~~~
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40520|23|5|Named parameters cannot start with an '
' character
 40519: _F64(buffer, byteOffset, length);
 40520: static _F64(_arg0, [_arg1, arg2]) native "Float64Array_constructor_Callback";
                              ~~~~~
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40520|30|5|Named parameters cannot start with an '
' character
 40519: _F64(buffer, byteOffset, length);
 40520: static _F64(_arg0, [_arg1, arg2]) native "Float64Array_constructor_Callback";
                                     ~~~~~
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40527|22|5|Named parameters cannot start with an '
' character
 40526: _I8(buffer, byteOffset, length);
 40527: static _I8(_arg0, [_arg1, arg2]) native "Int8Array_constructor_Callback";
                             ~~~~~
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40527|29|5|Named parameters cannot start with an '
' character
 40526: _I8(buffer, byteOffset, length);
 40527: static _I8(_arg0, [_arg1, arg2]) native "Int8Array_constructor_Callback";
                                    ~~~~~
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40534|23|5|Named parameters cannot start with an '
' character
 40533: _I16(buffer, byteOffset, length);
 40534: static _I16(_arg0, [_arg1, arg2]) native "Int16Array_constructor_Callback";
                              ~~~~~
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40534|30|5|Named parameters cannot start with an '
' character
 40533: _I16(buffer, byteOffset, length);
 40534: static _I16(_arg0, [_arg1, arg2]) native "Int16Array_constructor_Callback";
                                     ~~~~~
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40541|23|5|Named parameters cannot start with an '
' character
 40540: _I32(buffer, byteOffset, length);
 40541: static _I32(_arg0, [_arg1, arg2]) native "Int32Array_constructor_Callback";
                              ~~~~~
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40541|30|5|Named parameters cannot start with an '
' character
 40540: _I32(buffer, byteOffset, length);
 40541: static _I32(_arg0, [_arg1, arg2]) native "Int32Array_constructor_Callback";
                                     ~~~~~
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40548|22|5|Named parameters cannot start with an '
' character
 40547: _U8(buffer, byteOffset, length);
 40548: static _U8(_arg0, [_arg1, arg2]) native "Uint8Array_constructor_Callback";
                             ~~~~~
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40548|29|5|Named parameters cannot start with an '
' character
 40547: _U8(buffer, byteOffset, length);
 40548: static _U8(_arg0, [_arg1, arg2]) native "Uint8Array_constructor_Callback";
                                    ~~~~~
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40555|23|5|Named parameters cannot start with an '
' character
 40554: _U16(buffer, byteOffset, length);
 40555: static _U16(_arg0, [_arg1, arg2]) native "Uint16Array_constructor_Callback";
                              ~~~~~
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40555|30|5|Named parameters cannot start with an '
' character
 40554: _U16(buffer, byteOffset, length);
 40555: static _U16(_arg0, [_arg1, arg2]) native "Uint16Array_constructor_Callback";
                                     ~~~~~
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40562|23|5|Named parameters cannot start with an '
' character
 40561: _U32(buffer, byteOffset, length);
 40562: static _U32(_arg0, [_arg1, arg2]) native "Uint32Array_constructor_Callback";
                              ~~~~~
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40562|30|5|Named parameters cannot start with an '
' character
 40561: _U32(buffer, byteOffset, length);
 40562: static _U32(_arg0, [_arg1, arg2]) native "Uint32Array_constructor_Callback";
                                     ~~~~~
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40569|23|5|Named parameters cannot start with an '
' character
 40568: _U8C(buffer, byteOffset, length);
 40569: static _U8C(_arg0, [_arg1, arg2]) native "Uint8ClampedArray_constructor_Callback";
                              ~~~~~
ERROR|RESOLVER|NAMED_PARAMETERS_CANNOT_START_WITH_UNDER|dart://html/html_dartium.dart/html_dartium.dart|40569|30|5|Named parameters cannot start with an '
' character
 40568: _U8C(buffer, byteOffset, length);
 40569: static _U8C(_arg0, [_arg1, _arg2]) native "Uint8ClampedArray_constructor_Callback";
                                     ~~~~~
Compilation failed with 18 problems.

@vsmenon
Copy link
Member

vsmenon commented Jun 12, 2012

cc @rakudrama.
Removed Area-UI label.
Added Area-DOM label.

@vsmenon
Copy link
Member

vsmenon commented Jun 12, 2012

https://chromiumcodereview.appspot.com/10543115/


Set owner to @vsmenon.
Added Started label.

@DartBot
Copy link
Author

DartBot commented Jun 13, 2012

This comment was originally written by antonm@google.com


I believe that was a deliberate decision as we didn't want to expose names of arguments into public API.

And I believe as well that there was a plan to allow _-prefixed named arguments.

Gilad, Kasper, any comments?


cc @gbracha.
cc @kasperl.

@gbracha
Copy link
Contributor

gbracha commented Jun 13, 2012

The discussion about this has gone back and forth many times. The spec explains the problems allowing this would cause. There is a plan to allow unnamed optional arguments which should mitigate the pain.

@DartBot
Copy link
Author

DartBot commented Jun 13, 2012

This comment was originally written by antonm@google.com


Thanks a lot for clarifications, Gilad. What do you all think, is now the right time to get rid of _ perfices or we'd better wait for unnamed optional arguments?

I think chances are really low that someone will use named argument and we're still in alpha so it's okay to change that at our will, but I'd prefer to have this decided before M1.

@vsmenon
Copy link
Member

vsmenon commented Jun 13, 2012

Anton: in the case Eric reported, the '_' prefixes were only in private static methods, so I went ahead and removed them.

Are we still using this trick to hide params in public APIs?

@gbracha
Copy link
Contributor

gbracha commented Jun 13, 2012

The positional optional argument proposal will be decided in a week or two I'm sure. I had suggested to Erik he might want to wait, but he said he'd be ok with fixing all the occurrences right now. If that is not too onerous, that's best. Cases that turn out to be difficult could wait. It will all be done by M1.

@DartBot
Copy link
Author

DartBot commented Jun 13, 2012

This comment was originally written by antonm@google.com


Vijay@, looks like you're right, somehow they have disappeared and I missed that :(

Gilad@, thanks for clarifications.

@vsmenon
Copy link
Member

vsmenon commented Jun 20, 2012

Added Fixed label.

copybara-service bot pushed a commit that referenced this issue Sep 12, 2023
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/f5750f5..dd28f4c):
  dd28f4ce  2023-09-11  dependabot[bot]  Bump actions/cache from 3.3.1 to 3.3.2 (#3497)
  2ac7e323  2023-09-11  dependabot[bot]  Bump actions/upload-artifact from 3.1.2 to 3.1.3 (#3496)

ecosystem (https://github.com/dart-lang/ecosystem/compare/2e6c3ec..e96fbdb):
  e96fbdb  2023-09-12  Moritz  Try a fix for the health check socket issues (#164)
  4cc5005  2023-09-11  Alexander Thomas  Add missing license header to license.dart (#166)
  3fbab6c  2023-09-10  Moritz  Fix boolean condition in `publish.yaml` (#163)

http (https://github.com/dart-lang/http/compare/7fb6fd6..de19214):
  de19214  2023-09-12  Sam Rawlins  Avoid passing a nullable value to Completer<nn-type>.complete (#1015)

native (https://github.com/dart-lang/native/compare/a2dfedc..5177659):
  5177659  2023-09-12  Daco Harkes  [native_assets_builder] Speedup builds for 0 or 1 packages with native assets (#129)
  7f30f4b  2023-09-12  Daco Harkes  [native_assets_builder] Take packageLayout for build and dryRun (#127)
  a7cd31e  2023-09-12  Daco Harkes  `PackageLayout` constructor for already parsed `PackageConfig` (#126)
  9f24b64  2023-09-11  Daco Harkes  [native_toolchain_c] Fix MSVC x86 toolchain resolution (#124)
  07e1de5  2023-09-06  Daco Harkes  Reenable example on CI + roll dep (#122)
  387f894  2023-09-06  Gabriel Terwesten  [native_toolchain_c] Default handling for PIC/PIE compiler flags (#121)
  0a4e5f8  2023-09-06  Gabriel Terwesten  Add support for defines to `CBuilder` (#120)

test (https://github.com/dart-lang/test/compare/27dcae1..6449495):
  64494959  2023-09-11  Jacob MacDonald  skip failing wasm tests (#2091)
  83ae0d9f  2023-09-07  Jacob MacDonald  Fix running browser tests that use deferred loading (#2090)

tools (https://github.com/dart-lang/tools/compare/2c8cbd6..fa01f9b):
  fa01f9b  2023-09-11  Elias Yishak  `--disable-telemetry` --> `--disable-analytics` (#145)

webdev (https://github.com/dart-lang/webdev/compare/9487a45..6b21ecf):
  6b21ecf0  2023-09-11  dependabot[bot]  Bump actions/labeler from 4.2.0 to 4.3.0 (#2177)
  78a5fece  2023-09-11  Sam Rawlins  Avoid passing a nullable value to Future<nn-type>.value or Completer<nn-type>.completer. (#2205)
  6f282432  2023-09-11  Parker Lougheed  [webdev] Hide `--null-safety` option (#2206)
  1c5a7bc7  2023-09-11  Parker Lougheed  Replace deprecated lints (#2208)
  f0656b4a  2023-09-11  Parker Lougheed  Fix a few minor spelling mistakes (#2209)
  158223b2  2023-09-11  Parker Lougheed  Update old dartlang.org links to new .dev equivalents (#2210)
  a8d114c5  2023-09-11  Elliott Brooks  Update the comment for lookupResolvedPackageUris
  76e050c6  2023-09-11  Elliott Brooks  Clear the map of relative URIs on DartUri.clear()
  38a17ced  2023-09-11  dependabot[bot]  Bump dart-lang/setup-dart from 1.3.0 to 1.5.0 (#2212)
  cca9e56d  2023-09-11  Elliott Brooks  Reset Webdev after release (#2227)
  824dcef7  2023-09-11  Elliott Brooks  Reset DWDS after release (#2225)
  45c09a80  2023-09-08  Elliott Brooks  Prepare Webdev for release to 3.0.8 (#2224)
  805d3b7e  2023-09-08  dependabot[bot]  Bump actions/cache from 3.2.2 to 3.3.2 (#2223)
  85d4e760  2023-09-08  Elliott Brooks  Prepare DWDS for release to version 21.0.0 (#2221)
  a3757f06  2023-09-08  Anna Gringauze  Run monorepo generate (#2222)
  c991e85a  2023-09-07  dependabot[bot]  Bump actions/checkout from 3.2.0 to 4.0.0 (#2219)
  9851c23c  2023-09-07  Parker Lougheed  Update SDK constraints for Dart 3.0 and 3.1 stable releases (#2207)

Change-Id: I0caf74af171916d30eb8ee2ab78c15acaebaa229
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325560
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants