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

NamedParameter[6,8]NegativeTests passes for the wrong reasons on dart2js. #351

Closed
DartBot opened this issue Nov 5, 2011 · 18 comments
Closed
Labels
area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test). P1 A high priority bug; for example, a single project is unusable or has many test failures
Milestone

Comments

@DartBot
Copy link

DartBot commented Nov 5, 2011

This issue was originally filed by [email protected]


These 4 tests are all expecting compile-time errors due to invalid uses of named parameters. However, they also have an Expect.equals(true, false) in them which will cause them to pass (as negative tests) even if the correct compile-time checks are not implemented.

Running these tests directly on each implementation has shown (to the best of my understanding):
VM: Handles these correctly and will pass tests after they are fixed.
DartC: Does not perform the correct checks - and passes these tests only because they are broken.
Frog: Current performs exactly like dartc - but I will submit a CL later today so that Frog will match the VM.

I've marked status as high because having accurate and precise tests is of very high-value at this stage of the project.

@DartBot
Copy link
Author

DartBot commented Nov 8, 2011

This comment was originally written by [email protected]


Added Area-Compiler, Triaged labels.

@kasperl
Copy link

kasperl commented Nov 9, 2011

I think we should rewrite the tests as a single multi-test like FauxverrideTest. That way we'll know that the test fails for the right reasons (on the right lines) and that the test pass if all problematic lines are removed.

@scheglov
Copy link
Contributor

scheglov commented Nov 9, 2011

Set owner to @scheglov.
Added Accepted label.

@scheglov
Copy link
Contributor

Hm...
I don't see in spec that method of interfaces are not allowed to have optional parameters with default values. Can you point on item in spec?

@DartBot
Copy link
Author

DartBot commented Nov 14, 2011

This comment was originally written by [email protected]


8 Interfaces

[...]

It is a compile-time error if any default values are specifi ed in the signature of an interface method, getter, setter or constructor.

@scheglov
Copy link
Contributor

DartC is fixed to pass these tests without Expect.equals(true, false).

I change area to Area-Frog, once it will be fixed, probably should be changed to Area-Test.


Removed Area-Compiler label.
Added Area-Frog label.

@dgrove
Copy link
Contributor

dgrove commented Nov 29, 2011

Added this to the FrogEditor milestone.

@dgrove
Copy link
Contributor

dgrove commented Nov 29, 2011

Removed the owner.

@dgrove
Copy link
Contributor

dgrove commented Nov 30, 2011

as of r1908, all of these tests pass on dartc, frog, and the VM with the Expect.equals(true, false) manually removed.

Moving to Area-Test so that the tests can be fixed.


Removed this from the FrogEditor milestone.
Removed Area-Frog label.
Added Area-Test label.

@whesse
Copy link
Contributor

whesse commented Jun 14, 2012

If we remove the "Expect.equals(true, false);" line, and run the tests on dart2js, the tests will fail (meaning they run with no errors, since they are negative tests.

So someone should commit the change that fixes the tests, update the status file, and file bugs on dart2js that the syntax errors are not found.


Removed Area-Test label.
Added Area-Dart2JS label.
Changed the title to: "NamedParameter[6,8]NegativeTests passes for the wrong reasons on dart2js.".

@whesse
Copy link
Contributor

whesse commented Jun 14, 2012

Added this to the M1 milestone.

@peter-ahe-google
Copy link
Contributor

Yes, someone should change the test. The test is broken.


Removed Area-Dart2JS label.
Added Area-Test label.

@DartBot
Copy link
Author

DartBot commented Jul 15, 2012

This comment was originally written by @aam


I have looked at this defect and made small changes to dart2js parser(parser.dart, partial_parser.dart) so that parsing of formal parameters is dependent on whether it is invoked from parsing of named function alias or not. That is very similar to how it is done in dart(C++) compiler.

However, with the way how dart2js parser is written it scans typedefs without going into deep analysis of the formal parameters first, parses them more carefully if typedefs are used in the code.

So with my changes code below fails compilation with "parameter must not specify a default value"

===
typedef void Callback([String msg = ""]);

main() {
  Callback cb1 = null;
}
===

but the code below(original named_parameters6) compiles without errors because Callback is not used.
===
typedef void Callback([String msg = ""]);

main() {
}
===

Is this "relaxed" mode of parsing expected for dart2js parser?

Same thing with named_parameters8_negative_test: you need to add InstallCallback invocation so that parser takes closer look at formal parameters.
===
main() {
  C c = new C();
+++ c.InstallCallback(null);
}
===

If this kind of errors need to be flagged even if types/methods are not used, then this verification needs to be moved to scanner(partial_parser).

@DartBot
Copy link
Author

DartBot commented Jul 19, 2012

This comment was originally written by @aam


Here is codereview link for the patch for your review, please:
https://chromiumcodereview.appspot.com/10800027.

This fixes two tests referenced above as well as fixes named optional named params issue in dart2js parser.

@peter-ahe-google
Copy link
Contributor

I'll work with Alexander on getting this submitted.


Added Started label.

@peter-ahe-google
Copy link
Contributor

Set owner to @peter-ahe-google.

@peter-ahe-google
Copy link
Contributor

Set owner to [email protected].

@DartBot
Copy link
Author

DartBot commented Aug 30, 2012

This comment was originally written by @aam


Committed as http://code.google.com/p/dart/source/detail?r=11573


Added Fixed label.

@DartBot DartBot added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test). labels Aug 30, 2012
@DartBot DartBot added this to the M1 milestone Aug 30, 2012
copybara-service bot pushed a commit that referenced this issue May 19, 2023
…, http_parser, leak_tracker, logging, markdown, matcher, mockito, shelf, source_map_stack_trace, tools

Revisions updated by `dart tools/rev_sdk_deps.dart`.

async (https://github.com/dart-lang/async/compare/d744058..96c29d0):
  96c29d0  2023-05-17  Goddchen  docs: fix typo in CancelableOperation.fromFuture(...) docs (#243)

csslib (https://github.com/dart-lang/csslib/compare/923edf0..b2b9b55):
  b2b9b55  2023-05-18  Devon Carew  address a regression in the compact output format (#183)
  1ff82fd  2023-05-15  Devon Carew  blast_repo fixes (#181)
  35bef7f  2023-05-11  Nate Bosch  Simplify TopLevelIncludes visitor (#180)
  c4e904c  2023-05-10  Devon Carew  rev for publishing (#179)
  c9e47d0  2023-05-10  Kevin Moore  Require Dart 2.19, latest lints, skin hanging test (#175)
  3976e6f  2023-05-10  Devon Carew  address an issue parsing font names (#168)
  a337a9a  2023-05-10  Devon Carew  fixed CssPrinter pretty print indent levels (#169)

fixnum (https://github.com/dart-lang/fixnum/compare/006a130..d9b9a2a):
  d9b9a2a  2023-05-17  Devon Carew  blast_repo fixes (#112)

glob (https://github.com/dart-lang/glob/compare/46403be..30f6aba):
  30f6aba  2023-05-17  Devon Carew  blast_repo fixes (#77)

html (https://github.com/dart-lang/html/compare/593d6f6..92eacab):
  92eacab  2023-05-17  Devon Carew  blast_repo fixes (#216)

http (https://github.com/dart-lang/http/compare/fb3b4be..d845560):
  d845560  2023-05-17  Devon Carew  blast_repo fixes (#933)

http_multi_server (https://github.com/dart-lang/http_multi_server/compare/d1fffed..a209cd5):
  a209cd5  2023-05-17  Devon Carew  blast_repo fixes (#55)

http_parser (https://github.com/dart-lang/http_parser/compare/5a33f5f..1ef3e56):
  1ef3e56  2023-05-17  Devon Carew  blast_repo fixes (#73)

leak_tracker (https://github.com/dart-lang/leak_tracker/compare/8ae200a..571c24a):
  571c24a  2023-05-18  Polina Cherkasova  Delete generate_diagrams.yaml (#67)
  f2029b6  2023-05-18  Devon Carew  blast_repo fixes (#66)
  474fd4f  2023-05-18  Polina Cherkasova  Separate testing. (#65)
  92a0b48  2023-05-17  Polina Cherkasova  Fixes to support G3. (#64)

logging (https://github.com/dart-lang/logging/compare/b75cba7..fa2486d):
  fa2486d  2023-05-18  Desislava Stefanova  Logger `onLevelChanged` notification (#138)

markdown (https://github.com/dart-lang/markdown/compare/6db8fc1..b951454):
  b951454  2023-05-18  Devon Carew  blast_repo fixes (#542)
  a714d95  2023-05-17  Zhiguang Chen  Fix delimiter row matching pattern for tables (#540)

matcher (https://github.com/dart-lang/matcher/compare/4dfd9ad..7e10117):
  7e10117  2023-05-18  Devon Carew  blast_repo fixes (#224)

mockito (https://github.com/dart-lang/mockito/compare/3fadd2d..28f174f):
  28f174f  2023-05-17  Ilya Yanok  Only check formatting with the stable SDK

shelf (https://github.com/dart-lang/shelf/compare/79e3cee..8793687):
  8793687  2023-05-18  dependabot[bot]  Bump actions/labeler from 4.0.2 to 4.0.3 (#353)
  2f1aefb  2023-05-18  Devon Carew  blast_repo fixes (#351)
  e1ca05d  2023-05-18  Devon Carew  Update no-response.yml (#349)

source_map_stack_trace (https://github.com/dart-lang/source_map_stack_trace/compare/09715f9..b83af01):
  b83af01  2023-05-18  Devon Carew  blast_repo fixes (#39)

tools (https://github.com/dart-lang/tools/compare/62c9604..49da4ca):
  49da4ca  2023-05-12  Polina Cherkasova  Add memory events. (#92)

Change-Id: I5cd1277e6df1d72f69569090d9a2381a2b81d5d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304460
Commit-Queue: Konstantin Shcheglov <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
Auto-Submit: Devon Carew <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test). P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

6 participants