Commit graph

82359 commits

Author SHA1 Message Date
Konstantin Shcheglov 311760f49c Deprecate 'withInformative' in link()
Change-Id: I6da8baf8cbac140b20351b5b93fc6858603ba8d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217380
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-20 04:03:32 +00:00
Stephen Adams d49d5a96f7 [dart2js] Rti-need fix for generic instantiations
The rti-need of an instantiation is not the same as the rti-need of the
instantiated generic function. The generic function might not use its
type arguments but the instantiation still needs the type arguments for
equality.

dart2js implements generic function instantiation by creating instances
of a helper class that is a subclass of `Closure`. The helper class needs
its type parameters since they are used in `==` and `toString()` methods.
The fix for #47054 is to add the dependency of the helper class type
parameters on the instantiation type arguments.

Change-Id: I9ecb18e1b61a8ad6549f35b572476b1ed7ebb88d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212037
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-10-19 23:48:31 +00:00
Konstantin Shcheglov aed00dc37c Revert "Issue 47073. Inherit covariant-by-declaration from any candidate."
This reverts commit 60535b95de.

Bug: https://b.corp.google.com/issues/203423390
Change-Id: Id096d464b4b992153dd9f3b140b475ec2b7b3b43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217288
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-19 23:40:41 +00:00
pq 378d304de8 document not bulk-fixable corrections
Change-Id: I90bb91258ec0c900719fe06fbd4003690384aa28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-10-19 23:15:01 +00:00
Johnni Winther 3006908d7e Revert "[cfe] Encapsulate Dill/SourceLoader.builders" and "[cfe] Move createLibraryBuilder methods to loaders"
This reverts commits 2bbb5dc907 and 0e7d0f5205.

Change-Id: I140ae6eab70102d39b1bec665bedd3a3dbfb02bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217300
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-10-19 23:14:11 +00:00
Stephen Adams 7ca94e913d [dart2js] Enable --csp by default.
`--no-csp` can be used to get the prior behaviour.

Change-Id: I63dc7374f9f856a25e4da4e83b4cb8af9b46c305
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216582
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-10-19 22:50:14 +00:00
Nicholas Shahan e7faaaf85d [ddc] Surface compile time errors in tests
- Module symbols tests now surface compile time errors from the
  code under test.
- Fix errors in the code being tested.

Change-Id: Ica549c710f41ee22ac784fba99f9e12be664ac5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217024
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-10-19 22:18:33 +00:00
Brian Wilkerson a18e51ff4d Add a test for bulk application of the remove_argument fix
Change-Id: I0cf9272d1e38adf6ef46965aef0b6f8c3bd9d558
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217287
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-10-19 21:52:34 +00:00
Brian Quinlan 8462f1da74 Fix a bug where Platform.operatingSystemVersion was incorrect in the iOS
simulator.

Also changes the MacOS implementation of that property.

TEST=platform_os_version_test.dart

Bug: 47138
Change-Id: I9134845a216423c8a383b804986af1ebb3c8d3d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214863
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-10-19 21:25:43 +00:00
Ahmed Ashour b7179853b5 [analyzer] add bulk and in-file fixes for AddTypeAnnotation
Fixes https://github.com/dart-lang/sdk/issues/47222

Change-Id: I9155efe8a26359a872bbe9a74fadbe82e1014340
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215762
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-10-19 21:22:44 +00:00
Bruno Leroux f1ace5928b [VMService] - Add getClassList to service.md TOC
TEST=cq

Bug: https://github.com/dart-lang/sdk/issues/47497
Change-Id: Ie7544dfa2cc48cea99fd74333837f9c43895d11a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217183
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-10-19 20:55:54 +00:00
Paul Berry b0b1534f3e Make checkUnassigned easier to debug in flow analysis tests.
This change adds a stack trace so that if the check fails, the user
sees the stack trace of the call to `checkUnassigned` prior to the
stack trace from the process of visiting the mini-AST.  Usually teh
stack trace from the call to `checkUnassigned` is much more useful in
debugging, since it allows the user to see the location of the problem
relative to the code being analyzed.

Change-Id: I125b4059ec740850919798cfa66bf7e8c7490213
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217283
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-10-19 19:49:03 +00:00
Ahmed Ashour f45a8553d0 [analyzer] ConvertToDoubleQuotes to be associated with prefer_double_quotes lint
Fixes https://github.com/dart-lang/sdk/issues/47352

Change-Id: Ieb111ecdf6d0c9c8c47559d90dfe76203965e5d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-10-19 19:40:13 +00:00
Konstantin Shcheglov b381186c91 Use runtimeTypesEqual() for FunctionState.isIdentical()
Bug: https://github.com/dart-lang/sdk/issues/46840
Change-Id: I48d257554ad5e4305168e37b18a6dbfc119b78c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217284
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-19 19:10:23 +00:00
Konstantin Shcheglov 3cd8dfe95b Deprecate MockSdk, switch to createMockSdk().
Change-Id: I512cd93af2f4aeab91f3d739c58c47572f3c4ede
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217151
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-19 18:52:15 +00:00
Brian Wilkerson ff34b81174 Support overlapping deletions in quick fixes
I believe that the tests cover the added behavior (and some existing
behavior), but they aren't complete. I'll add more tests over time, but
for now the test coverage is strictly better than it used to be.

Change-Id: I8dd228cb2b3c477c28e6d20c6da4a549a30d1afb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217280
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-10-19 18:36:23 +00:00
Paul Berry e5e8f84927 Rework how final and late are represented in flow analysis tests.
The fields `isFinal` and `isLate` are moved to the `Var` class.  This
should allow greater flexibility when experimenting with possible
changes in promotion behavior for final and late variables.

Bug: https://github.com/dart-lang/language/issues/1721
Change-Id: I3a328566b4a55244ca76c41da6e362066118d283
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217261
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-10-19 18:18:52 +00:00
Konstantin Shcheglov 95dc8bd415 Patch dart:ui/src/ui references.
Bug: https://buganizer.corp.google.com/issues/203423390
Change-Id: Ibbe2a304b9bbc3dddff684ca8ba1cc41b28507e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217281
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-19 18:05:55 +00:00
Ryan Macnak 1ef7e6a974 [vm, compiler] Use comparisons with the correct width for SpeculativeShiftUint32OpInstr.
Fixes failure to detect negative Smis with compressed pointers.

TEST=left_shift_bit_and_op_test on AppJIT
Change-Id: I2ca98f1af16eb62a309ddd8d6fe6d4a0e98e49c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217152
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-10-19 18:00:32 +00:00
pq 15d00a8586 bulk fix accounting for hints with correction producers
Sample run:

```
hints w/ correction producers:

HintCode.CAN_BE_NULL_AFTER_NULL_AWARE bulk fixable: false
HintCode.DEAD_CODE bulk fixable: false
HintCode.DEAD_CODE_CATCH_FOLLOWING_CATCH bulk fixable: false
HintCode.DEAD_CODE_ON_CATCH_SUBTYPE bulk fixable: false
HintCode.DIVISION_OPTIMIZATION bulk fixable: false
HintCode.DUPLICATE_HIDDEN_NAME bulk fixable: false
HintCode.DUPLICATE_IMPORT bulk fixable: false
  => override explanation missing for: RemoveUnusedImport
HintCode.DUPLICATE_SHOWN_NAME bulk fixable: false
HintCode.INVALID_FACTORY_ANNOTATION bulk fixable: false
HintCode.INVALID_IMMUTABLE_ANNOTATION bulk fixable: false
HintCode.INVALID_LITERAL_ANNOTATION bulk fixable: false
HintCode.INVALID_REQUIRED_NAMED_PARAM bulk fixable: false
HintCode.INVALID_REQUIRED_OPTIONAL_POSITIONAL_PARAM bulk fixable: false
HintCode.INVALID_REQUIRED_POSITIONAL_PARAM bulk fixable: false
HintCode.INVALID_SEALED_ANNOTATION bulk fixable: false
HintCode.MISSING_REQUIRED_PARAM bulk fixable: false
HintCode.MISSING_REQUIRED_PARAM_WITH_DETAILS bulk fixable: false
HintCode.MISSING_RETURN bulk fixable: false
HintCode.NULLABLE_TYPE_IN_CATCH_CLAUSE bulk fixable: true
HintCode.OVERRIDE_ON_NON_OVERRIDING_FIELD bulk fixable: false
HintCode.OVERRIDE_ON_NON_OVERRIDING_GETTER bulk fixable: false
HintCode.OVERRIDE_ON_NON_OVERRIDING_METHOD bulk fixable: false
HintCode.OVERRIDE_ON_NON_OVERRIDING_SETTER bulk fixable: false
HintCode.SDK_VERSION_AS_EXPRESSION_IN_CONST_CONTEXT bulk fixable: false
HintCode.SDK_VERSION_ASYNC_EXPORTED_FROM_CORE bulk fixable: false
HintCode.SDK_VERSION_BOOL_OPERATOR_IN_CONST_CONTEXT bulk fixable: false
HintCode.SDK_VERSION_EQ_EQ_OPERATOR_IN_CONST_CONTEXT bulk fixable: false
HintCode.SDK_VERSION_EXTENSION_METHODS bulk fixable: false
HintCode.SDK_VERSION_GT_GT_GT_OPERATOR bulk fixable: false
HintCode.SDK_VERSION_IS_EXPRESSION_IN_CONST_CONTEXT bulk fixable: false
HintCode.SDK_VERSION_SET_LITERAL bulk fixable: false
HintCode.SDK_VERSION_UI_AS_CODE bulk fixable: false
HintCode.TYPE_CHECK_IS_NOT_NULL bulk fixable: false
  => override explanation missing for: UseNotEqNull
HintCode.TYPE_CHECK_IS_NULL bulk fixable: false
  => override explanation missing for: UseEqEqNull
HintCode.UNDEFINED_HIDDEN_NAME bulk fixable: false
HintCode.UNDEFINED_SHOWN_NAME bulk fixable: false
HintCode.UNNECESSARY_CAST bulk fixable: true
HintCode.UNNECESSARY_IMPORT bulk fixable: false
  => override explanation missing for: RemoveUnusedImport
HintCode.UNNECESSARY_NULL_COMPARISON_FALSE bulk fixable: false
HintCode.UNNECESSARY_NULL_COMPARISON_TRUE bulk fixable: false
HintCode.UNUSED_CATCH_CLAUSE bulk fixable: false
HintCode.UNUSED_CATCH_STACK bulk fixable: false
HintCode.UNUSED_ELEMENT bulk fixable: false
HintCode.UNUSED_FIELD bulk fixable: false
HintCode.UNUSED_IMPORT bulk fixable: false
  => override explanation missing for: RemoveUnusedImport
HintCode.UNUSED_LABEL bulk fixable: false
HintCode.UNUSED_LOCAL_VARIABLE bulk fixable: false
HintCode.UNUSED_SHOWN_NAME bulk fixable: false
```



Change-Id: I9d6e86854d7f1de43ac8154631610869bf56c2c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217149
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-10-19 17:57:52 +00:00
pq 4d35418b6f fix unused_result false positive
Fixes: https://github.com/dart-lang/sdk/issues/47473

Change-Id: Idc8a7c029dd3f081cda5c0d3d2ca4929156fcc98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217161
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-19 17:09:02 +00:00
Konstantin Shcheglov de16d277d7 Fix MockSdk to be more backward compatible.
Bug: https://buganizer.corp.google.com/issues/203503644
Change-Id: I7dffc8b80597cd21cc41261678e74ba90a4e7e8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-19 16:23:42 +00:00
Lasse R.H. Nielsen 2c36db9b0a Deprecate IntegerDivisionByZeroException.
Deprecates the class and makes it implement `Error` (more specifically
`UnsupportedError`).
Code throwing `IntegerDivisionByZeroException` should be migrated to
throwing `unsupportedError` directly, code catching the exception class
should start catching `UnsupportedError` immediately (or reconsider why
they are catching at all).

Integer division by zero also covers other ways that a double division
can give a non-number result (any infinity or NaN result of the division prior to calling `truncate()` on the result, will cause `~/` to throw).

Fixes #46776

Bug: https://github.com/dart-lang/sdk/issues/46776
Change-Id: Idf2657153dd16542e72c6ba921f587dd9fc9032a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208643
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-10-19 16:07:52 +00:00
Alexander Thomas 056afdac39 [testing] Merge dart2js-batch into the global batch option
* Remove all uses of `--dart2js-batch`.
* Enable batch mode for dart2js by default.
* Rename `--noBatch` to `--no-batch`.
* Make `--no-batch` affect dart2js configurations.

Change-Id: I33bdb5cfe8a82ccfc6ce9e43843f1b7a34ff1fbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217006
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-10-19 13:49:02 +00:00
Clement Skau 0cd81027f4 Set correct fileUri on FfiNative fields.
`currentLibrary.fileUri` points to the library file (e.g. ui.dart)
and not the class-containing `part` file (e.g. compositing.dart).
This causes `fileOffset` out-of-bounds and `location` to fail.

Failing stack trace:
Unhandled exception: Crash when compiling null, at character offset null:
RangeError (offset): Invalid value: Not in inclusive range 0..1257: 1543
#0      RangeError.checkValueInInterval (dart:core/errors.dart:282:7)
#1      Source.getLocation (package:kernel/ast.dart:13919:16)
#2      Component.getLocation (package:kernel/ast.dart:13692:31)
#3      _getLocationInComponent (package:kernel/ast.dart:14212:22)
#4      Field._getLocationInEnclosingFile (package:kernel/ast.dart:2363:12)
#5      TreeNode._getLocationInEnclosingFile (package:kernel/ast.dart:206:20)
#6      TreeNode.location (package:kernel/ast.dart:202:12)
#7      _FfiUseSiteTransformer._ensureNativeTypeToDartType (package:vm/transformations/ffi_use_sites.dart:744:35)
[...]

TEST=Existing.
Change-Id: I17b3ab23abcb04aca046509e7cdbb177ed156e54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217186
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-10-19 13:09:46 +00:00
Jonas Finnemann Jensen 51573a9c92 Bump pub to 400f21e9883ce6555b66d3ef82f0b732ba9b9fc8
Changes:
```
> git log --format="%C(auto) %h %s" 35681b0..400f21e
 https://dart.googlesource.com/pub.git/+/400f21e9 migrate pub client (except tests) to null-safety (#3178)
 https://dart.googlesource.com/pub.git/+/909852fc Remove unused `pub run --dart-dev` (#3177)

```

Diff: https://dart.googlesource.com/pub.git/+/35681b0126a1fb48bf2062dd09f74296715402c2~..400f21e9883ce6555b66d3ef82f0b732ba9b9fc8/
Change-Id: If428fda768156f8923be3d739e80b9ac9a37eb87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217188
Auto-Submit: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-10-19 12:40:17 +00:00
Johnni Winther 0cbaee4c30 [cfe] Pass reference for lowered static late fields
Fixes fuzz test of static_field_lowering/opt_in

Change-Id: Ia0199e0cf3471a9b100e5f442ccfaad2930d94bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217187
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-10-19 12:32:57 +00:00
Johnni Winther c206ec38ce [cfe] Pass ReferenceFromIndex to value class transformation
This fixes fuzz testing for value_class/empty,
value_class/explicit_mixin, and value_class/value_mixin_error

Change-Id: Ia098b3ed5b8a028f1a28c5579fe5df11e5a92ff0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217185
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-10-19 10:02:38 +00:00
Chloe Stefantsova 82dc2cf255 [analyzer] Disable check for argument order if experiment is enabled
Part of https://github.com/dart-lang/sdk/issues/47451.

Change-Id: I6e13e8642c287c2386f7a323ccd5e41d83c5b358
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217012
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Chloe Stefantsova <dmitryas@google.com>
2021-10-19 09:24:27 +00:00
Johnni Winther 565d0977d1 [cfe] Handle Procedure.signatureType in transformers
Change-Id: I2e32883c2e2cebaa48335d1aa3a1d1834d3a8106
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217182
Reviewed-by: Chloe Stefantsova <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-10-19 09:24:07 +00:00
Kevin Moore 38f764f4b8 vm math patch: use a singleton for Random.secure
Seems to be zero upside to creating a new instance every time

Change-Id: I8cf372f654225ee5f599fd0c36019607c1186fc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217143
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-10-19 09:09:00 +00:00
Johnni Winther a5de2458f6 [cfe] Use correct Name for lookup of private forwarding constructors
Fixes fuzz testing of general/issue46581 and general/issue46581/main

Change-Id: Idb03be55756dec0a861006484a457a6911fc9adf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217017
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-10-19 08:40:08 +00:00
Daco Harkes 0cd586486b [cfe/ffi] Move FFI transforms into folder
Having the transforms in a dedicated folder enables us to add more files
without cluttering the transformations folder itself.

TEST=This only moves files. Bots test whether imports are correct.

Change-Id: Icf1d64b5ec09a7d19915b1cb72464fa67b6cfe15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217180
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-10-19 07:25:09 +00:00
Daco Harkes 1868b119e7 [vm/ffi] Cleanup outdated documentation
This file as not been updated in a long time, and we're not using it
as the ground truth for CFE/analyzer checks.

TEST=This is deleting a markdown file.

Change-Id: I4872223a889407800c2f0d6a6092f7db4200967c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217018
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-19 05:50:58 +00:00
Sam Rawlins 37b3ed798f Fix references to StaticWarningCodes which are now CompileTimeErrorCodes
Change-Id: I89390b6f89de4301460e092b8828d720ac9c3224
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217155
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-10-19 04:54:50 +00:00
Sigmund Cherem 38b5a841de [dart-web] Remove dart:web_sql library.
The WebSQL standard was abandoned more than 10 years ago and is not
supported by many browsers.

The `dart:web_sql` library was marked as deprecated in Dart 2.14. This
CL makes the library inaccesible, removes support for `dart:web_sql` imports,
and removes the `Window.openDatabase` API. The old code for `dart:web_sql` is
still generated by the html generators. Removing that will be handled by a
separate change.

Closes https://github.com/dart-lang/sdk/issues/46316

Change-Id: I892107396b3b227b4f33344377585aa5e5328288
Bug: https://github.com/dart-lang/sdk/issues/46316
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216080
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-10-19 01:00:08 +00:00
Konstantin Shcheglov 5fff311900 Add createMockSdk(), a replacement for MockSdk.
This makes MockSdk a factory for FolderBasedDartSdk.
In a next CL I will deprecate MockSdk, and update SDK clients.

Change-Id: I1a24c70d2e9b902150f80ccaaa8a84d5e385058f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217150
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-18 21:37:54 +00:00
Brian Quinlan b89382ad4e Use full path for link to gethostname
Add some documentation for

Change-Id: Iea03e02afac304f4d6a17103b2e99d123bdc9d48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217141
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2021-10-18 20:36:14 +00:00
Paul Berry 04c8ef2bf1 Reduce the use of <unnamed> in analyzer error messages.
Two error messages are affected:

1. When the user tries to access a static member of an extension
through an instance of a class that mentions the extension's "on"
type, and that extension is unnamed, we now report
INSTANCE_ACCESS_TO_STATIC_MEMBER_OF_UNNAMED_EXTENSION instead of
INSTANCE_ACCESS_TO_STATIC_MEMBER.  The new error message is the same
as the old one (and uses the same sharedName), but it omits the
correction message suggesting to the user that they try accessing the
static method directly via the extension name, since this advice
doesn't apply.

2. When we report AMBIGUOUS_EXTENSION_MEMBER_ACCESS, if one of the
ambiguous members comes from an unnamed extension, we now report the
unnamed extension as "unnamed extension on '$type'" rather than
referring it to as an extension named `<unnamed>`.

Change-Id: I3ca3a1ccc9399b26b083040de20db8e4f691be32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217102
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-10-18 19:27:18 +00:00
Riley Porter d17fd4b14f Reland "Re-land "Add a generic return type for js_util functions""
This reverts commit b70a134933.

Reason for revert: google3 linter bugs disabled with a comment and Flutter PR with new js_util landed with ignore comments. Should be safe to reland.

Original change's description:
> Revert "Re-land "Add a generic return type for js_util functions""
>
> This reverts commit 66cbeb6718.
>
> Reason for revert: Causes dart analyzer and dart linter to find
> issues within google3 and flutter, causing breakages and blocking
> the roll.
>
> Original change's description:
> > Re-land "Add a generic return type for js_util functions"
> >
> > This relands commit 46486cf260.
> >
> > The differences from the original commit:
> >   - jsify is no longer being made generic
> >   - Updated the CHANGELOG
> >
> > Change-Id: Ibc3402833cce2babbec9a57ad73963d7b9442ed8
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216920
> > Commit-Queue: Riley Porter <rileyporter@google.com>
> > Reviewed-by: Sigmund Cherem <sigmund@google.com>
>
> TBR=sigmund@google.com,srujzs@google.com,rileyporter@google.com
>
> Change-Id: Ic2ff63bc9658ccafcab3db75bdd06814d2f17b76
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216963
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ia8c753b568b0aca10e7784126048bddd9e1ab976
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217148
Reviewed-by: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-10-18 18:41:53 +00:00
Ryan Macnak 60d2df4a42 [vm, gc] Consider external memory when deciding whether an idle scavenge is worthwhile.
Otherwise a heap can accumulate just under 128MB (4 * max new-space capacity) worth of new-space external data without triggering a GC.

TEST=--verbose-gc
Change-Id: Ifaa5e4ea9277f1f4a09b722897b508a192c3297f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215142
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-10-18 18:32:43 +00:00
Paul Berry 267323de7d Remove unnecessary declaration names from error codes.
The errors HintCode.INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION and
CompileTimeErrorCode.EXTENSION_CONFLICTING_STATIC_AND_INSTANCE didn't
really need to name the enclosing declaration, since the user can
easily find the enclosing declaration from the location of the error
message.  Without this change, there are some situations where an
error message would awkwardly refer to an unnamed extension as having
the name `<unnamed>`.

Change-Id: I4ddec389f18e78167464b1b5c35556e92dd1c15f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216860
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-18 18:26:04 +00:00
Konstantin Shcheglov b5022a7693 Remove unused 'nullSafePackages' and 'sdkVersion' from MockSdk.
Change-Id: I281ae17a94181d2a5d769e030faf4b5f4d667792
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217145
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-18 18:01:43 +00:00
Konstantin Shcheglov c50982e0b7 Deprecate InterfaceType.getSmartLeastUpperBound()
Change-Id: Ia626e41015bffcbc49b48d4065b5a2420e60487a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217142
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-18 17:38:30 +00:00
Konstantin Shcheglov 413a08ef7c Suggest constructors when ConstructorReference and matching context type.
Change-Id: I4506365286b327687563d3c7c7fede077256697c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217062
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-18 17:34:39 +00:00
Konstantin Shcheglov 2626eb025e Stop using 'nullSafePackages' and 'sdkVersion' for MockSdk.
There is a released version with Null Safety, and so we don't need
to allow-list packages, and test with pre-release versions.

Change-Id: Ia0f574155df32f326c2e3ff56f1564cbb103e8cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217060
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-18 17:10:29 +00:00
Konstantin Shcheglov 60535b95de Issue 47073. Inherit covariant-by-declaration from any candidate.
Bug: https://github.com/dart-lang/sdk/issues/47073
Change-Id: I1ae779d50f1e4ee63f005098f9a22615c744480a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217081
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-18 16:45:59 +00:00
Konstantin Shcheglov f904b30c8d Tweaks for LinkedElementFactory.
Change-Id: I5011c2182d870eb35460df227e08b1493434fb8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-18 16:39:38 +00:00
Devon Carew 840a8aada4 [core libs] add the ability to have sample assumptions when validating the api docs
Change-Id: Ic2d0af4dd033b09fb5b0fcf4f57a48da367b6f1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216681
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2021-10-18 16:11:48 +00:00
Erik Ernst ace8c34996 Adjust language{,_2}/regress/regress31596_covariant_declaration_test
These tests are updated to match the behavior which was specified in
dart-lang/language#1833. The change is valid for both language_2 and
language because it isn't tied to a language version. This should not
break any existing code because it only changes programs with
compile-time errors into programs with no errors.

(If we agree on this change then I'll approve the failures.)

Change-Id: I49f41fd1b1575c237c9c619c912de3e8de53356f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217016
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-10-18 15:58:09 +00:00