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

Bad diagnostic for duplicated imports #8464

Closed
peter-ahe-google opened this issue Feb 11, 2013 · 6 comments
Closed

Bad diagnostic for duplicated imports #8464

peter-ahe-google opened this issue Feb 11, 2013 · 6 comments
Assignees
Labels
type-enhancement A request for a change that isn't a bug web-dart2js

Comments

@peter-ahe-google
Copy link
Contributor

I changed sdk/lib/_internal/compiler/implementation/js_backend/js_backend.dart to import js.dart as jsAst, and added an this top-level field to js.dart:

const js = const jsAst.JsBuilder();

This resulted in this error message:

sdk/lib/_internal/compiler/implementation/js_backend/js_backend.dart:38:7: Warning: duplicated definition
const js = const jsAst.JsBuilder();
      ^^
Error: duplicate definition

Turns out that we are saying:

          compiler.reportError(import.prefix, 'duplicate definition');

Not:

        compiler.withCurrentElement(importingLibrary, () {
          compiler.reportError(import.prefix, 'duplicate definition');
        });

In importLibrary in library_loader.dart. With that change, I get this error message:

sdk/lib/_internal/compiler/implementation/js_backend/js_backend.dart:38:7: Warning: duplicated definition
const js = const jsAst.JsBuilder();
      ^^
sdk/lib/_internal/compiler/implementation/ssa/ssa.dart:10:27: Error: duplicate definition
import '../js/js.dart' as js;
                          ^^

Which is better, but still not good enough. I'd also like to know where the import declaration is, that is, where in ssa.dart is the import of js_backend.dart?

@kasperl
Copy link

kasperl commented Apr 22, 2013

Added this to the Later milestone.

@kasperl
Copy link

kasperl commented May 23, 2013

Added TriageForM5 label.

@kasperl
Copy link

kasperl commented May 28, 2013

Removed TriageForM5 label.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@johnniwinther
Copy link
Member

This has been rendered obsolete by the change in prefix/non-prefix import semantics in https://codereview.chromium.org//27008003

@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed triaged labels Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug web-dart2js
Projects
None yet
Development

No branches or pull requests

5 participants