Skip to content

Commit

Permalink
dart2js: do typechecking even if suppressWarnings is on
Browse files Browse the repository at this point in the history
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=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1411153005 .
  • Loading branch information
harryterkelsen committed Oct 21, 2015
1 parent ba60781 commit a4bfe1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/compiler/lib/src/compiler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1989,9 +1989,9 @@ class _CompilerResolution implements Resolution {
assert(invariant(element, !element.isSynthesized || tree == null));
ResolutionImpact resolutionImpact =
compiler.resolver.resolve(element);
if (tree != null &&
!compiler.analyzeSignaturesOnly &&
!reporter.options.suppressWarnings) {
if (tree != null && !compiler.analyzeSignaturesOnly) {
// TODO(het): don't do this if suppressWarnings is on, currently we have
// to do it because the typechecker also sets types
// Only analyze nodes with a corresponding [TreeElements].
compiler.checker.check(element);
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/compiler/lib/src/typechecker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class TypeCheckerTask extends CompilerTask {
}

/**
* Class used to report different warnings for differrent kinds of members.
* Class used to report different warnings for different kinds of members.
*/
class MemberKind {
static const MemberKind METHOD = const MemberKind("method");
Expand Down

0 comments on commit a4bfe1f

Please sign in to comment.