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

DDC gets confused when Object has static members. #34387

Closed
lrhn opened this issue Sep 6, 2018 · 3 comments
Closed

DDC gets confused when Object has static members. #34387

lrhn opened this issue Sep 6, 2018 · 3 comments
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@lrhn
Copy link
Member

lrhn commented Sep 6, 2018

This CL adds static members to Object.
When building the SDK (tools/build.py -mrelease -ax64 create_sdk) I get the following error:

Command failed: tools/sdks/dart-sdk/bin/dart --dfe=tools/sdks/dart-sdk/bin/snapshots/kernel-service.dart.snapshot pkg/dev_compiler/tool/build_pkgs.dart --analyzer-sdk out/ReleaseX64/gen/utils/dartdevc/ddc_sdk.sum --kernel-sdk out/ReleaseX64/gen/utils/dartdevc/kernel/ddc_sdk.dill --output out/ReleaseX64/gen/utils/dartdevc
output: [error] Static members from supertypes must be qualified by the name of the defining type. (package:path/src/path_map.dart, line 9, col 62)
[error] Static members from supertypes must be qualified by the name of the defining type. (package:path/src/path_set.dart, line 9, col 58)

Please fix all errors before compiling (warnings are okay).

The path package library lines in question are:

/// A map whose keys are paths, compared using [equals] and [hash].

and

/// A set containing paths, compared using [equals] and [hash].

So, the error is in the unmatched reference in the DartDoc. Those should be [Context.equals] and [Context.hash]. However, that doesn't mean that finding the static hash in Object is in any way correct, because it is not visible at that point. The reference here is still just undeclared, it is not magically referencing the static Object.hash, and it is not OK to make it an error.
(Make it an error to have an undeclared reference, but don't invent references that are not there).

Blocking #11617

@lrhn lrhn added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dev-compiler P1 A high priority bug; for example, a single project is unusable or has many test failures labels Sep 6, 2018
@lrhn
Copy link
Member Author

lrhn commented Sep 12, 2018

@lrhn lrhn added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Sep 12, 2018
@lrhn
Copy link
Member Author

lrhn commented Sep 12, 2018

Adding area-analyzer since the error code seems to come from the analyzer (UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER in codes.dart), but it is qualified as a warning there, not an error, so I expect it's DDC making it an error.

Side note: Maybe it would be simpler to just not have DDC spend time on analyzing comments. Seems like an unnecessary overhead for a compiler.

@scheglov scheglov assigned scheglov and unassigned vsmenon Nov 6, 2018
@scheglov
Copy link
Contributor

scheglov commented Nov 6, 2018

@scheglov scheglov closed this as completed Nov 7, 2018
dart-bot pushed a commit that referenced this issue Nov 7, 2018
… in a documentation comment.

Also consolidate comment reference resolution tests.

R=brianwilkerson@google.com, paulberry@google.com

Bug: #34387
Change-Id: I3c75c1679c7a880705e6aff9d2f5477eb81a7f11
Reviewed-on: https://dart-review.googlesource.com/c/83223
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants