35334b5227
This CL introduces a new abstract getter 'isConst' for Member class in
the AST. This change ought to be non-breaking since every subclass of
Member implements a boolean getter 'isConst'.
The primary motivation for introducing this change is that it enables
us to simplify some of the code base by eliminating some tedious
branching and/or casts to dynamic when we need to determine whether a
member is constant, e.g.
bool isConst = false;
if (member is Procedure) isConst = member.isConst;
else if (member is Constructor) isConst = member.isConst;
else if ...
becomes
bool isConst = member.isConst;
and
if ( (member as dynamic).isConst ) { ... }
becomes
if (member.isConst) { ... }
Change-Id: Ifcc3229c7a19dd8f261266f58df5eef562167885
Reviewed-on: https://dart-review.googlesource.com/71403
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>