The method CT.test is passed either Expect.isTrue or Expect.isFalse,
both of which expect a second argument of type String.
Change-Id: I4f661d5758b52d4a78df5ab9cae9072d0180739a
Reviewed-on: https://dart-review.googlesource.com/19285
Reviewed-by: Morten Krogh-jespersen <mkroghj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The signature for Isolate.spawn requires that the entry point have
type `(dynamic) -> void`. Previously we were passing in `(SendPort)
-> void` (a more general type).
Change-Id: Ied0803cf01c06fd65ee0746e1a2f988cbc05cf82
Reviewed-on: https://dart-review.googlesource.com/19286
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The signature for Isolate.spawn requires that the entry point have
type `(dynamic) -> void`. Previously we were passing in `(SendPort)
-> void` (a more general type).
Change-Id: I598f9320375c9f8e053b347b0ae08d0b7bba4973
Bug:
Reviewed-on: https://dart-review.googlesource.com/19280
Reviewed-by: Jakob Roland Andersen <jakobr@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
checkIntFunction and checkIntFuncFunction need to be able to handle
different types of functions being passed to them. The easiest way to
achieve this is to make them generic.
Change-Id: I1afd13fa9514244a33d2ba7ace1f137f01b2f2a8
Reviewed-on: https://dart-review.googlesource.com/19284
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
These tests verify that the static type of an async function/method,
the reified type of a tear-off of that function/method, and the
runtime type of the future it returns, are all consistent with each
other.
Change-Id: Idf1fb77c5ae9445a36e18d2acc15fd45aa3411e5
Reviewed-on: https://dart-review.googlesource.com/19063
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
forEach will be passed functions of type `(int) -> int`, so its
signature needs to accept them; previously its signature only accepted
`(dynamic) -> int` (a more specific type).
Change-Id: Ibe7116f05d3c9d73f01c090836a9b11bb7dcf597
Reviewed-on: https://dart-review.googlesource.com/19221
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
In strong mode, it is a compile-time error to attempt to pass C to a
function requiring A, since types A and C are unrelated.
Change-Id: Ifdd974ece6d040393ac2945c9393bb9683f09c64
Reviewed-on: https://dart-review.googlesource.com/19220
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This CL modifies the Dart source used from test.py such that it takes
`syntax error` into account as an expected outcome in test files (so
that we can have `//# 01: syntax error` with a similar meaning as
`//# 01: compile-time error`).
For all tools except the spec_parser, `syntax error` is the same
outcome as `compile-time error`; that is, nobody else will see the
difference.
For the spec_parser, `syntax error` is the outcome where parsing has
failed; `compile-time error` is taken to mean some other compile-time
error, i.e., the spec_parser is expected to _succeed_ when the
expected outcome is `compile-time error`.
Test files in language and language_2 have been adjusted to use the
outcome `syntax error` where appropriate.
The status files in language and language_2 for the spec_parser have
been adjusted such that they fit all the new `syntax error` outcomes
in test files.
Other status files have been adjusted in a few cases where tests were
corrected (because a compile-time error which was clearly not intended
to be a syntax error turned out to be caused by a typo, which means
that the actual compile-time error has never been tested).
The spec grammar Dart.g was adjusted in a few cases, when some bugs
were discovered. In particular, the treatment of Function has been
changed: It is now known by the parser that Function does not take
any type arguments. This makes no difference for developers, because
they cannot declare a type named Function anyway, but it means that
a number of tricky parsing issues were resolved.
Dart.g was also adjusted to allow `qualified` to contain three
identifiers, which is an old bug (preventing things like metadata on
the form `@p.C.myConst`).
Change-Id: Ie420887d45c882ef97c84143365219f8aa0d2933
Reviewed-on: https://dart-review.googlesource.com/18262
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
If the URI of a directive is invalid, use a special URI with a
scheme marking it as malformed. In the loader, treat a file with
an invalid URI as empty.
Order all dependencies (imports and exports) by source position to
allow the DietListener to match them up properly with metadata.
For the same reason, add imports and exports within parts to
dependencies even though they are not permitted here.
Closes https://github.com/dart-lang/sdk/issues/30997
Closes https://github.com/dart-lang/sdk/issues/31004
Change-Id: Ic7efd0da058c246531c165508b7474475b4bdad2
Reviewed-on: https://dart-review.googlesource.com/17901
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Notes on test changes:
- This revealed runtime failures in some tests in
pkg/front_end/testcases/inference. Since these tests were never
meant to exercise runtime behavior in the first place, I just
changed them so that main() does nothing.
- This revealed runtime failures in some tests in tests/language_2.
These tests began failing because they used "var" for a fields and
then later assigned a value to the field that was incompatible with
the inferred type. It looks like the intent was for these fields to
have type "dynamic", so I changed the tests accordingly.
Change-Id: I0ddb2063427b52b5e4be1884fa333e25be4bf4f3
Reviewed-on: https://dart-review.googlesource.com/16881
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This is for compatibility with Kernel, as well as fixing several bugs,
and generally being a more robust architecture.
This may also perform better than the current design.
Notable fixes include several issues around deferred classes.
Change-Id: I1b6f44ebdf6304b10b47d19026156a25e04146ef
Reviewed-on: https://dart-review.googlesource.com/16337
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Currently, the Kernel FE doesn't set up parent pointers correctly for
signature function types. This prevents type parameters on generic
function types from being finalized correctly. In addition, finalization
of generic interface types within a generic function type can crash if they
reference not-yet-finalized type parameters of the enclosing function type.
This review solves both issues. Several failing tests pass again, although
more thorough testing is blocked on Github issue #31213 (nested generic function
types crashing in Fasta).
Bug:
Change-Id: Ib5ee6b2566492e3fd6688fe5a6b6976692562ea1
Reviewed-on: https://dart-review.googlesource.com/16360
Reviewed-by: Régis Crelier <regis@google.com>