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

Ungraceful error: Already found a mapping for inlining short name #1964

Open
SLaks opened this issue Aug 18, 2016 · 3 comments
Open

Ungraceful error: Already found a mapping for inlining short name #1964

SLaks opened this issue Aug 18, 2016 · 3 comments
Labels

Comments

@SLaks
Copy link
Contributor

SLaks commented Aug 18, 2016

goog.module('a');

const a = goog.require('a');
const a = goog.require('a');

Result:

java.lang.RuntimeException: INTERNAL COMPILER ERROR.
Please file a bug at http://go/jscompiler-bug with this stack trace, sponge link, and repro steps (a CL# and a build target).

Already found a mapping for inlining short name: a
  Node(CALL): input0:4:10
const a = goog.require('a');
  Parent(NAME a): input0:4:6
const a = goog.require('a');

    at com.google.common.base.Preconditions.checkState(Preconditions.java:523)
    at com.google.javascript.jscomp.ClosureRewriteModule.recordNameToInline(ClosureRewriteModule.java:1296)
    at com.google.javascript.jscomp.ClosureRewriteModule.updateGoogRequire(ClosureRewriteModule.java:860)

https://closure-compiler-debugger.appspot.com/#input0%3Dgoog.module('a')%253B%250A%250Aconst%2520a%2520%253D%2520goog.require('a')%253B%250Aconst%2520a%2520%253D%2520goog.require('a')%253B%26input1%26conformanceConfig%26externs%26refasterjs-template%26includeDefaultExterns%3D1%26CHECK_SYMBOLS%3D1%26CHECK_TYPES%3D1%26CLOSURE_PASS%3D1%26LANG_IN_IS_ES6%3D1%26MISSING_PROPERTIES%3D1%26PRESERVE_TYPE_ANNOTATIONS%3D1%26PRETTY_PRINT%3D1%26TRANSPILE%3D1

@MatrixFrog
Copy link
Contributor

Er, shouldn't this be a syntax error (or at least an early error in CheckVars or something) to have two const as?

@MatrixFrog MatrixFrog added the bug label Aug 18, 2016
@SLaks
Copy link
Contributor Author

SLaks commented Aug 18, 2016

Yes, but it should not be an INTERNAL COMPILER ERROR.

This might be caused by ClosureRewriteModule running before the real error.

@Dominator008
Copy link
Contributor

@MatrixFrog I now think VariableReferenceCheck should run before the closure passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants