Skip to content

Commit a4bfe1f

Browse files
dart2js: do typechecking even if suppressWarnings is on
this is necessary because the type of elements will not be set unless the typechecker runs on the element. You need the type to be set even when suppressWarnings is on because in checked mode it is an error to declare a compiled constant with inconsistent field types Fixes #24653 BUG= [email protected] Review URL: https://codereview.chromium.org/1411153005 .
1 parent ba60781 commit a4bfe1f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/compiler/lib/src/compiler.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,9 +1989,9 @@ class _CompilerResolution implements Resolution {
19891989
assert(invariant(element, !element.isSynthesized || tree == null));
19901990
ResolutionImpact resolutionImpact =
19911991
compiler.resolver.resolve(element);
1992-
if (tree != null &&
1993-
!compiler.analyzeSignaturesOnly &&
1994-
!reporter.options.suppressWarnings) {
1992+
if (tree != null && !compiler.analyzeSignaturesOnly) {
1993+
// TODO(het): don't do this if suppressWarnings is on, currently we have
1994+
// to do it because the typechecker also sets types
19951995
// Only analyze nodes with a corresponding [TreeElements].
19961996
compiler.checker.check(element);
19971997
}

pkg/compiler/lib/src/typechecker.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class TypeCheckerTask extends CompilerTask {
7575
}
7676

7777
/**
78-
* Class used to report different warnings for differrent kinds of members.
78+
* Class used to report different warnings for different kinds of members.
7979
*/
8080
class MemberKind {
8181
static const MemberKind METHOD = const MemberKind("method");

0 commit comments

Comments
 (0)