dart-lang / dart-lang/language

Are setter names in the scope of an imported or exported library?

Open
#1,471 7 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
TeX
Stars
2.9k
Forks
239
Avg merge
2d 18h
Merged PRs (30d)
14

Description

The following code is considered erroneous by both the analyzer and the CFE, despite there being a setter named `x` declared in `lib1.dart`. The spec implies that this introduces a name `x=` into the scope, so I would expect that such a name could be shown/hidden. Is this WAI, or is this a bug in the tooling?

```dart
import "lib1.dart" show x=;

export "lib1.dart" show x=;
```

cc @eernstg @munificent @lrhn

Contributor guide

Open the contributing guide

Research direction

Start with the specification passage about setter names in import and export scopes, then reproduce the lib1.dart example with both the analyzer and the CFE. Compare their diagnostics with the spec's treatment of `x=` and determine whether the behavior is intended or requires coordinated specification and tooling changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.