Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3272,6 +3272,19 @@ void walkInnerSymbols(ObjectType type, String innerNamespace) {
}
}
if (foundNamespaceMembers) emitNamespaceEnd();

// Recursively repeat the process for inner types of inner types.
for (NamedTypePair namedType : innerProps.keySet()) {
JSType pType = namedType.type;
String qualifiedName = innerNamespace + '.' + namedType.name;

// This probably could be extended to enums and interfaces, but I rather wait for for some
// real world use-cases before supporting what seems like a bad way to organize closure
// code.
if (isClassLike(pType)) {
walkInnerSymbols((FunctionType) pType, qualifiedName);
}
}
}

private void visitFunctionExpression(String propName, FunctionType ftype) {
Expand Down
24 changes: 24 additions & 0 deletions src/test/java/com/google/javascript/clutz/double_inner_class.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
declare namespace ಠ_ಠ.clutz {
class module$exports$iterated$innerclass {
private noStructuralTyping_module$exports$iterated$innerclass : any;
}
}
declare namespace ಠ_ಠ.clutz.module$exports$iterated$innerclass {
class B {
private noStructuralTyping_module$exports$iterated$innerclass_B : any;
}
}
declare namespace ಠ_ಠ.clutz.module$exports$iterated$innerclass.B {
class C {
private noStructuralTyping_module$exports$iterated$innerclass_B_C : any;
}
}
declare namespace ಠ_ಠ.clutz.module$exports$iterated$innerclass.B.C {
class D {
private noStructuralTyping_module$exports$iterated$innerclass_B_C_D : any;
}
}
declare module 'goog:iterated.innerclass' {
import innerclass = ಠ_ಠ.clutz.module$exports$iterated$innerclass;
export default innerclass;
}
25 changes: 25 additions & 0 deletions src/test/java/com/google/javascript/clutz/double_inner_class.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
goog.module('iterated.innerclass');

/**
* @struct
*/
class A {}

/**
* @struct
*/
A.B = class {};

/**
* @struct
*/
A.B.C = class {};

/**
* @struct
*/
A.B.C.D = class {
};


exports = A;