Skip to content

Relative and absolute imports don't resolve to the same path #33432

Closed
@Hixie

Description

@Hixie

A common case we see is this:

// main.dart
import 'package:app/bar.dart';

class A { }

void main() {
  assert(new A().runtypeType == test().runtimeType); // fails
}
// bar.dart
import 'package:app/main.dart';

A test() {
  return new A();
}

This fails because the import in bar.dart resolves to a different path than what we first run, so there's two copies of main.dart floating around. It results in extremely confused developers.

See e.g. flutter/flutter#17575.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions