Sitelet https://github.com/angular/angular/commit/024ebe668c27668e3cc48023ba48ef24468bdfbb
Skip to content

Commit 024ebe6

Browse files
crisbetothePunderWoman
authored andcommitted
fix(compiler): do not copy expression type into output AST variables
The `DeclareVarStmt` constructor has some logic that takes the type from its initializer. This is incorrect, because if the initializer is a function, it'll take its return type. These changes remove the fallback logic altogether since it's misleading. (cherry picked from commit 1879be0)
1 parent c3e8f29 commit 024ebe6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/compiler/src/output/output_ast.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@ export class DeclareVarStmt extends Statement {
16141614
leadingComments?: LeadingComment[],
16151615
) {
16161616
super(modifiers, sourceSpan, leadingComments);
1617-
this.type = type || (value && value.type) || null;
1617+
this.type = type || null;
16181618
}
16191619
override isEquivalent(stmt: Statement): boolean {
16201620
return (

0 commit comments

Comments
 (0)