Skip to content
Closed
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 @@ -228,7 +228,10 @@ class TemplateVisitor<Code extends ErrorCode>
visitBoundText(text: TmplAstBoundText): void {
this.visitAst(text.value);
}
visitIcu(icu: TmplAstIcu): void {}
visitIcu(icu: TmplAstIcu): void {
Object.keys(icu.vars).forEach((key) => this.visit(icu.vars[key]));
Object.keys(icu.placeholders).forEach((key) => this.visit(icu.placeholders[key]));
}

visitDeferredBlock(deferred: TmplAstDeferredBlock): void {
deferred.visitAll(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,14 @@ runInEachFileSystem(() => {

expect(diags.length).toBe(0);
});

it('should not report a @let declaration that is only used in an ICU', () => {
const diags = diagnose(`
@let value = 1;
<h1 i18n>{value, select, 1 {one} 2 {two} other {other}}</h1>
`);

expect(diags.length).toBe(0);
});
});
});