Commit graph

9 commits

Author SHA1 Message Date
Erik Ernst 8eaeb87500 Correct 4 static type expectations in test
Work on https://github.com/dart-lang/sdk/issues/54002 revealed that the
test least_upper_bound_greatest_closure_1_test.dart contains 4 static
type expectations that are incorrect according to the definition of `UP`
and this CL corrects those expectations.

The updates associated with 54002 will change the behavior of the cfe
and the analyzer such that they have the correct expectations (they
currently succeed with the incorrect static type expectations, that is,
they need to be updated in order to compute `UP` correctly, but that
will occur as part of the update described in 54002, so we will
approve the test failures caused by this CL and refer to 54002).

Change-Id: Iec6ba253eea9f85efc8af67b372bd7f160145a22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337726
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-11-27 10:38:31 +00:00
Erik Ernst c9e24eee9f Add test for upper bound with greatest closure
Change-Id: I59d20c1b4c874fb24a67f15296654d54a0d0dc1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179541
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-01-21 08:51:53 +00:00
Erik Ernst 0cf3c37e9e Adjust tests verifying the static type dynamic
Change-Id: Icf229e3877ce646340b6dad1bd49c20110953d44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169885
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-10-30 16:10:30 +00:00
Erik Ernst 7e75ea38a2 Discriminate more precisely in least_upper_bound_function_test, f4
language/least_upper_bound/least_upper_bound_function_test.dart would
succeed if in `f4` the type of `z` were any top type. The type actually
expected is `Object?`. This CL adds some extra steps to `f4` to ensure
that it rejects other top types.

Change-Id: Ie2d042d54e83bf3e9c9db0c432ca32e90c5bbc6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166850
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-10-12 16:39:02 +00:00
Erik Ernst a369992f4b Corrections in lub tests, cf. #43717, #43720.
The tests least_upper_bound_{futureor,function}_test.dart are corrected:
The expected least upper bound was changed in one case in each test,
because the case matches a rule earlier in the ruleset, so the new rules
are not used in these cases.

Change-Id: I1f5f303ccde10af6084771a90d92d81d636909d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166635
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-10-09 11:22:46 +00:00
Erik Ernst 2ffa46326b Add test dealing with UP on types involving FutureOr
Cf. spec change https://github.com/dart-lang/language/pull/1254,
commit ae340c7dcc62d375bd8df9fd4cb0d669d84478d2.

Change-Id: I28c950ee37c21e138fb7148950b0404004086eff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166626
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-10-09 07:05:16 +00:00
Erik Ernst 87dd7c03e1 Add tests for least upper bound spec change #1195
https://github.com/dart-lang/language/pull/1195 changes the UP function
such that it uses the greatest closure with bounded and promoted type
variables, and adjusts the catch-all rules about function types (used
with `Function(int)` and `String` and other "otherwise" cases).

This PR adds tests for the updated rules.

Change-Id: I793b85ceec76105d013c03e8d9bccdd187bb476f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166101
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-10-08 10:49:33 +00:00
Konstantin Shcheglov 8de8a1c226 Move codes from StaticTypeWarningCode into CompileTimeErrorCode.
They are all errors now.

Change-Id: If48d38e38e845fd5b5a950dd5514bf1cbbce03d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-27 16:44:15 +00:00
Robert Nystrom 1b8f589d3c Migrate language_2/least_upper_bound to NNBD.
Change-Id: Id1cffba25214323478af50a8ae539236377d53c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149047
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-05-30 00:55:26 +00:00