Skip to content

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

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

Closed
Hixie opened this issue Jun 12, 2018 · 5 comments
Closed

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

Hixie opened this issue Jun 12, 2018 · 5 comments
Assignees
Labels
closed-duplicate Closed in favor of an existing report legacy-area-front-end Legacy: Use area-dart-model instead.

Comments

@Hixie
Copy link
Contributor

Hixie commented Jun 12, 2018

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.

@kevmoo
Copy link
Member

kevmoo commented Jun 12, 2018

There are existing discussions on how main(...) should ever be in the lib directory, right?

@leafpetersen
Copy link
Member

Is this a dup of #33076 ?

@leafpetersen
Copy link
Member

See also #32601 ?

@Hixie
Copy link
Contributor Author

Hixie commented Jun 12, 2018

both of those look like the same thing, yup.

@dgrove dgrove added the legacy-area-front-end Legacy: Use area-dart-model instead. label Jun 13, 2018
@lrhn
Copy link
Member

lrhn commented Jun 15, 2018

This is an instance of what #33076 should fix, so closing as duplicate of that.

@lrhn lrhn closed this as completed Jun 15, 2018
@lrhn lrhn added the closed-duplicate Closed in favor of an existing report label Jun 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report legacy-area-front-end Legacy: Use area-dart-model instead.
Projects
None yet
Development

No branches or pull requests

6 participants