Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Fix enum bug in module legacy namespace. #928

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nbeloglazov
Copy link
Contributor

@nbeloglazov nbeloglazov commented Sep 27, 2019

No description provided.

@nbeloglazov
Copy link
Contributor Author

Actually hold on. I think the bug is not fixed. Clutz produces different output depending on goog.module name I just got lucky in the test.

@nbeloglazov
Copy link
Contributor Author

Ready for review.

@nbeloglazov nbeloglazov changed the title Add test for https://github.com/angular/clutz/issues/872 Fix enum bug in module legacy namespace. Oct 4, 2019
@@ -1893,6 +1893,7 @@ private void visitEnumType(String symbolName, String qualifiedName, EnumType typ
emit(elementsTypeName);
emit(";");
emitBreak();
typesUsed.add(elementsTypeName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this fix the 'enu' or 'enum' test (or both)?

@rkirov
Copy link
Contributor

rkirov commented Oct 24, 2019

Can you rebase, this looks good.

@nbeloglazov
Copy link
Contributor Author

nbeloglazov commented Oct 25, 2019

This change doesn't work in one case like:

goog.module('foo');

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

/** @enum {number} */
const Color = bar.Color;
exports.Color = Color;

where bar is coming from another module (so its source is not processed by Clutz). Need to figure out how it should be handled.

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

Successfully merging this pull request may close these issues.

3 participants