Skip to content

"part" in lib and "part of" in bin breaks analyzer #52951

Open
@treeplate

Description

@treeplate

Dart SDK version: 3.1.0-246.0.dev (dev) (Fri Jun 23 01:04:39 2023 -0700) on "macos_arm64"
How to reproduce issue:
dart create foo
in foo/lib/foo.dart:

library foo;

part '../bin/foo.dart';

int x = 3;

in foo/bin/foo.dart:

part of '../lib/foo.dart';

void main(List<String> arguments) {
  print(x);
}

remove the test directory.
dart analyze:

Analyzing foo...              0.5s

  error • bin/foo.dart:4:9 • Undefined name 'x'. Try correcting the name to one that is defined, or defining the name. • undefined_identifier
  error • lib/foo.dart:3:6 • Target of URI doesn't exist: 'package:foo/bin/foo.dart'. Try creating the file referenced by the URI, or try using a URI for a file that
          does exist. • uri_does_not_exist

2 issues found.

dart run:

Building package executable... 
Built foo:foo.
3

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.dart-model-analyzer-specIssues with the analyzer's implementation of the language spectype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions