This is in preparation for detecting if a generator header has checks.
By not registering the redundant checks (which should really done in codegen) we remove a few $isXXX flags.
Change-Id: I30deb2bc498858540cd326243798248c51ce9375
Reviewed-on: https://dart-review.googlesource.com/56006
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This ensures that the resulting Iterable will have the proper type
when run with strong mode semantics.
In Dart 1.0 semantics, the type argument to .map is ignored, so this
change should be safe.
Change-Id: I34924bc7e803b1520af7d174cfe80f5be6b7ac0f
Reviewed-on: https://dart-review.googlesource.com/55908
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This is necessary because many call sites invoke toUserString without
first casting to one of the derived classes.
This should be safe since both derived classes (SourceLocation and
UnresolvedSourceLocation) contain a definition of toUserString.
Change-Id: I69eeda326883d87fc4e8cedd732881d250cae8cb
Reviewed-on: https://dart-review.googlesource.com/55909
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This CL fixes some cases where Observatory mistakenly tried to use a
C-style parameter declaration, e.g.
void foo(String);
The intent is to declare the parameter to have type `String`, but Dart
interprets the parameter as having *name* `String` and type `dynamic`.
In most cases the fix applies to abstract method declarations, whose
types aren't semantically relevant in Dart 1.0, so these parts of the
CL should be safe.
In one case it applies to a typedef, IsConnectedVMTargetDelegate. The
only use of this typedef is as the type of
TargetRepository._isConnectedVMTarget, whose value is always the
static function ObservatoryApplication.isConnectedVMTarget. The type
of ObservatoryApplication.isConnectedVMTarget matches the typedef
(according to Dart 1.0 rules) both before and after the change, so
this should be safe as well.
Change-Id: Ia67f5f14d5a012ccb8a44cbd88a8233f8c9ad171
Reviewed-on: https://dart-review.googlesource.com/55901
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This CL addresses a code pattern where a method has a more general
return type than it needs, causing a strong mode error at the site
where the method is called or torn off. For example:
Object f() => 'x';
void g(String callback()) { ... }
void h() {
g(f); // Error: () -> Object is not a subtype of () -> String
}
The solution is to tighen up the return type. In all cases in this
CL, it is obvious from the method definition that the value returned
at runtime will satisfy the tighter return type, so this should be a
safe change.
Change-Id: Ifbd476d969274342653d2619c1c81e2e014817c4
Reviewed-on: https://dart-review.googlesource.com/55904
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Summary:
The constants table contains a concatenation of the variable-length encodings of
each constant used in the serialized component. Previously, we referenced the
constants in the code by index into the constants table, which requires reading
potentially the entire constants table to dereference. Now, we refer to the
constant by the binary offset into the constants table, which allows us to peek
into it in constant time.
Test Plan:
The constants table is used by all the precompiler modes, so the new encoding
will inherit the coverage of the existing encoding.
Results from debug and release precompiler bots are available under the
"cl-linux-try" button.
Change-Id: I4782bc0035d0b0cbd5bd6b9d086561ea601286c8
Reviewed-on: https://dart-review.googlesource.com/55470
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This CL replaces several calls to parseTypeVariablesOpt with calls
to computeTypeParam with improved recovery for missing '>'.
In addition, this CL
* moves isOneOfOrEof to util.dart
* moves insertSyntheticIdentifierAfter into TokenStreamRewriter
Change-Id: I48080809d156dd98ccfed7aa2f67be254f4da201
Reviewed-on: https://dart-review.googlesource.com/55940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
We have to close the fds we got from the namespace before destroying
the namespace.
Change-Id: I3298868a444d262b4ded147a1dc8eb1a99c92a1c
Reviewed-on: https://dart-review.googlesource.com/55983
Reviewed-by: Zach Anderson <zra@google.com>
We always have fully reoslved unit, so usually actual types are available.
For the case when the type annotation cannot be resolved, keep the
old code that returns unresolved type string in this case. Probably
can be simplified more, e.g. remember declared types on the side instead
of passing them around just in case. Later.
R=brianwilkerson@google.com
Change-Id: Ida0b6caa90fc1408e5e7d12b762b19651cb201f6
Reviewed-on: https://dart-review.googlesource.com/55980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
* `unrelated_type_equality_checks` now allows comparison between `Int64` or `Int32` and `int`
* `unnecessary_parenthesis` improved to handle cascades _in_ cascades
Change-Id: I588893132e04a706e9fc93a7a16a07005465eb1f
Reviewed-on: https://dart-review.googlesource.com/55914
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>