Code like `/// See also [List.new].` will be accepted as a valid comment
reference.
Test in front_end, analyzer, analysis_server.
Remove TODOs in analyzer for reporting a reference to an element whose
library is not the library in which the comment is found.
Bug: https://github.com/dart-lang/sdk/issues/47446
Change-Id: Ifa19278f92ac003082b62b121c66f0559c0152e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216583
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
For CompileTimeErrorCode.UNDEFINED_METHOD, it was possible that the
undefined method reference might appear inside an unnamed extension
declaration. This was fixed by changing the error message to refer to
the extended type rather than the extension name.
For HintCode.INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION and
CompileTimeErrorCode.EXTENSION_CONFLICTING_STATIC_AND_INSTANCE, we
just allow the name to be `<unnamed>` when the declaration in question
is an unnamed extension.
For AnalysisOptionsWarningCode.UNRECOGNIZED_ERROR_CODE and
AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUES, it's
actually ok for `null` to show up in the error message, because it can
only happen if the user has a literal `null` in their options file.
However, the way we want this to work is by passing the string `null`
as an argument to the error message (rather than the `null` value);
this will allow us to make message arguments non-nullable in a
follow-up CL.
Change-Id: I67138f314e6234d860c01d083d7c08a1a3ef11ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216460
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Currently there is a strong link between dyn:-forwarder and
its target (through Function::data_ field). This link causes us
to retain some Function objects even if they are otherwise
considered dropped.
In reality this link is only ever used during compilation
or when accessing script information for the dyn:-forwarder.
As such when generating snapshots in DWARF stack traces mode
we should be able to consider this connection weak
and allow dropped Function objects to be truly discarded from
the snapshot.
This change puts WSR in between dyn:-forwarder and its target
when we know that target is not going to be retained.
We also clean how forwarding target represented to avoid
unnecessary indirection through a one-element array.
TEST=ci
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try
Change-Id: I4f0ec822ff15f78c72ff55a87d9dc52abd466cb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216040
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
The added field holds the interface signature type for a Procedure when
this is different from the class signature type (implied by the function
parameters and return type). This is needed for forwarding semi stubs
when its declared type is different from the called super member.
Closes https://github.com/dart-lang/sdk/issues/47072
TEST=pkg/front_end/testcases/general/implement_semi_stub.dart and more
Change-Id: I4a7cdc9d564fb0a59e7b06e83646b5410d8d82f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216420
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <dmitryas@google.com>
We don't need it anymore, a few years as probably.
Change-Id: Ieccb8fa303d8bc4595268ba6bde2b5da8bdc2731
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216541
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Enabling the CPU profiler on OSX/iOS with a lldb connection would cause
applications to slow to a crawl due to lldb performing checks on each
SIGPROF. This change replaces the SIGPROF based thread interrupter for
MacOS with one based on the Mach Thread APIs.
Fixes https://github.com/dart-lang/sdk/issues/47139
TEST=Manual testing, CQ
Change-Id: Iedfd73a83f92d51e01b98bfa281440c7d1ba9e08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216220
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Evaluation of a constructor's initializers (field initializers, assert
initializers, and super initializer) are all so much complexity separate
from evaluating a simpler const object that they deserve their own test
classes.
* Move all tests using assert initializers from very old
non_error_resolver.test and from constant.dart to
InstanceCreationEvaluatorTestCases.
* Move many test cases into *TestCases so they are tested in pre- and
post-null safety.
* Introduce more basic tests for assert initializers.
Bug: Preparation for https://github.com/dart-lang/sdk/issues/46081
Change-Id: Ie3e21d2457b1ba34667f85a0f5e3ef0e558f5cb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Most of these arguments are flowing through to a `--packages` argument
which allows passing the `package_config.json` file. In the long term we
should remove the `.packages` file entirely.
TEST=None, the change should have no visible impact.
Change-Id: I60a8b175d5e217a85588bbcb91cc5095514066b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211503
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
UntaggedClass::host_type_arguments_field_offset_in_words_ is initialized
when class is finalized. When comparing generic types for the class
which was not finalized, we cannot rely on the value of that field.
Intrinsified Type.operator== has been using host_type_arguments_field_offset_in_words_
to check if the class is generic, and has been treating classes which
are not finalized as non-generic. This has been causing the wrong
result for generic types which are different only in type arguments.
This change fixes Type.operator== intrinsics to check if
type arguments match even if class was not finalized.
Also, EquivalentClassIds helper was revised to take 3 labels
explicitly for all possible outcomes (instead of 2 labels and
a fall-through).
TEST=runtime/tests/vm/dart/regress_47425_test.dart
Fixes https://github.com/dart-lang/sdk/issues/47425
Change-Id: I3f49114644d44808c668df7cbb8a702cd42b3673
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216270
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Previously, the compile time errors EXPORT_OF_NON_LIBRARY,
EXPORT_INTERNAL_LIBRARY, and IMPORT_OF_NON_LIBRARY would redundantly
quote their URIs (e.g. an EXPORT_OF_NON_LIBRARY error message might
say "The exported library ''part.dart'' can't have a part-of
directive."). This change avoids the extra quoting by using the
string value of the URI as an argument to the error rather than the
AST node.
Change-Id: I64f250dcf15f638cfe4a3ade23bb2cd2c710a0d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216300
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This requires passing the runtime type arguments into the
InstanceCreationEvaluator, so that it can store them in a lexical scope
map.
Bug: https://github.com/dart-lang/sdk/issues/47302
Change-Id: I6b9d660f20b981d26810f29858784c034cc8abfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215960
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
It appears that invoking exit with a value other than either zero (0) or
254 causes the test infrastructure to interpret the failure as a failure
in the infrastructure, turning the bot purple rather than red. Thowing
an exception is interpreted correctly, so I believe that this change will
cause a need to regenerate to show up as a red bot.
Change-Id: I01e9fc2bfe09fac3da2a9aade69fabf3abd17179
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216260
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: I26b028a942d3d95c6bf135f983a22d02d31ddb34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215541
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
- Allows FfiNative annotation to be attached to non-static
methods of classes.
- Transforms non-static instance methods to static, adding
wrappers with the receiver as an extra, implicit first paramters.
- Transform all parameters and arguments to Pointer if the object
being passed supports it (i.e. extends NativeFieldWrapperClass1).
- Adds compile time errors for cases where the FfiNative annotation
doesn't align with the annotated function. Taking into account
implicit receivers and converted Pointers.
- Adds complimentary Analyzer checks for the above errors as well.
- Adds tests for the transforms, compile time errors and analyzer
changes.
TEST=Adds new tests for instance methods, analyzer changes.
Change-Id: Idf54430acf2728a650008333b149b254941290ad
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213773
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
This test has been using --optimization-counter-threshold=10 which
makes it extremely slow if kernel service snapshot is not used
(on ia32), as kernel service compiles a huge number of functions.
This change increases --optimization-counter-threshold to 100.
TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/47429
Change-Id: Iee49d5a97cc89f124b7f296ff70ebb6c5f359528
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216262
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
1. Implement oneTimeCleanup()
2. Run not 4, but 2 times.
3. Name it `das-flutter`, to add `edit` benchmarks later.
Change-Id: I4b1cc2e400a48f69901a9710ea8345371e64cfcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216141
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>