Change-Id: I224894b47a03c8b5cf48ddd3a125ba09a9a47a23
Reviewed-on: https://dart-review.googlesource.com/c/77842
Commit-Queue: Peter von der Ahé <ahe@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Change-Id: Id2db43c7e7822a912879c742629eeefcdeedd9a9
Reviewed-on: https://dart-review.googlesource.com/77724
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Demangle all names in messages to avoid printing mangled names in
user-facing output.
Point messages about implicit mixin application classes at the subclass
name for consistency with named mixin application classes.
Change-Id: I90973986c422f271af99e18b3deb5847adf4d430
Reviewed-on: https://dart-review.googlesource.com/c/77380
Reviewed-by: Kevin Millikin <kmillikin@google.com>
The code in class_hierarchy.dart that looped over override pairs
included implementations inherited from its superclass as potential
overriders, presumably in a broken attempt to include some interface
checks into the mix.
With this problem fixed, the special case in kernel_class_builder.dart
that excluded overriders not declared in the current class (i.e.
declared in a mixin) could be removed without incurring false
positives.
These override checks performed on members from a mixin produce an
extra context message indicating the class where the two members meet,
giving rise to the override relation (similarly to interface checks).
Since the same member can now override more than one member (or even
the same member more than once), the diagnostics message duplication
check has been extended to also include the context in the comparison.
Fixes https://github.com/dart-lang/sdk/issues/34235
Fixes https://github.com/dart-lang/sdk/issues/34285
Change-Id: I990e5719ae1749fd1aad1ad478aaa6e173cb170b
Reviewed-on: https://dart-review.googlesource.com/c/76900
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
When a member in the interface of a non-abstract class is found to
have an implementation with the correct name which does not override
the representative declaration of the member in the interface (and thus
has not been checked against that member for override validity), call
the override check to check interface validity.
Override relations thus checked produce an extra context message
explaining that the override relation must hold because both members
are inherited by a non-abstract class.
Fixes https://github.com/dart-lang/sdk/issues/32014
Change-Id: I955f057e35fa30f33c19da37c9cea1262042431c
Reviewed-on: https://dart-review.googlesource.com/c/74642
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
- Update outgoing part-of relative uris (may need changing)
- Add a helper for verifying failed refactor statuses
- Use the original file location for checking if in an analysis root
- Remove tests for functionality we're not yet supporting
- Remove forced failures and @failingTest for tests that work
Bug: https://github.com/dart-lang/sdk/issues/33605
Change-Id: I405bfcb92ce2ce66710caf934fc03e10eb66aea3
Reviewed-on: https://dart-review.googlesource.com/c/77541
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
I believe that in order to fix#34558 I will need to modify how
function types are built for typedefs. Before doing so, I want to
make sure I fully understand the (flawed) behavior of
FunctionTypeImpl.forTypedef.
See #34657 for more details about how the behavior of forTypedef is
flawed (and how I believe it ought to behave).
Change-Id: I15e981175da46e444425984a70cfda54e9e3749b
Reviewed-on: https://dart-review.googlesource.com/c/77721
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: Ica49f8446bc57dc9d7bd4d8460231dc9272542c6
Reviewed-on: https://dart-review.googlesource.com/c/77820
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Change-Id: I9882c2be31366cc85a1623a2b324ce4ec200aa20
Reviewed-on: https://dart-review.googlesource.com/c/77804
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
Change-Id: Iab61e0dfcdd0969d1bf35e27c13c336a944d14e6
Reviewed-on: https://dart-review.googlesource.com/c/77780
Commit-Queue: Peter von der Ahé <ahe@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Change-Id: Id3372bc0d64711438dee3eb5503ee6c809b3d40c
Reviewed-on: https://dart-review.googlesource.com/c/77740
Commit-Queue: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Also, convert package:vm to use onDiagnostic.
We're consolidating all dependencies on package:front_end in one file per tool.
The idea is, if you want to depend on something in the package:front_end, you modify pkg/front_end/lib/src/api_unstable/vm.dart and consult with the front-end team.
These consolidated files will help us when designing a public API in the future.
Change-Id: I66bafdd0ae29605fd12f8d6c589dbc761e5c7a97
Reviewed-on: https://dart-review.googlesource.com/c/77581
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
We use different graph implementation in Analyzer, CFE has its own.
And ConstantValueComputer is not used in Analyzer or anywhere internally.
R=brianwilkerson@google.com
Change-Id: I1abaca5205fa0af7c50675d2935b0d6f21373b31
Reviewed-on: https://dart-review.googlesource.com/c/77672
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
In the long run we should eliminate the code duplication between
InterfaceTypeImpl.isMoreSpecificThan and TypeSystem.isMoreSpecificThan
(see #34653), but this gets us past the immediate bug.
Fixes#34641.
Change-Id: I0a7935cff7a0d73728a918db7513e46ff73bc984
Reviewed-on: https://dart-review.googlesource.com/c/77676
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
- Remove all code that generates the corelib and dart:io library sources into C++ arrays and link them into dart_bootstrap
- Remove the executable dart_bootstrap and all uses of it
- Remove bootstrap_nolib.cc and builtin_nocore.cc
- Remove the Dart 1 code in core lib bootstrap path
Change-Id: Ifd33496204285a08b42fe09e39428e7a92b416b6
Reviewed-on: https://dart-review.googlesource.com/c/77241
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Ideally I think we should not use Expression.staticParameterElement to
get back to the corresponding parameter of the invoked FunctionType,
and do this check directly during resolution.
R=brianwilkerson@google.com
Change-Id: I6dbb5bf63f7eaad7f19b31129319e32dd4455acc
Reviewed-on: https://dart-review.googlesource.com/c/77641
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: Id1aef8c9185e4d1e660cc342d54a12923a890a43
Reviewed-on: https://dart-review.googlesource.com/77060
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Change-Id: Ifd3975becaeeb312a5c3ca12228828ea49a00d2b
Reviewed-on: https://dart-review.googlesource.com/76942
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Change-Id: I8dc408c1ffec9307e776288a8fb99604c7dedd6b
Reviewed-on: https://dart-review.googlesource.com/76664
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
That is, arguments that are null or empty.
Change-Id: I9b580f44ed960f2a0270c91fd8c98b9b43c7ceed
Reviewed-on: https://dart-review.googlesource.com/76604
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Change-Id: Id5f6c4158e70f5a444a6baec1374da20f961a4ec
Reviewed-on: https://dart-review.googlesource.com/76603
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Change-Id: I4065ca11064b7569c869f9ea665c85fd287432ce
Reviewed-on: https://dart-review.googlesource.com/76602
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Change-Id: Ic4cb0195722c5d5bbb83cd4463f12c0c32e0fc1a
Reviewed-on: https://dart-review.googlesource.com/77561
Commit-Queue: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Change-Id: I886bdb75902689a9880f9bac78f3d5dd07839fc3
Reviewed-on: https://dart-review.googlesource.com/76943
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
This reduces time required to verify constant errors on my Flutter
analysis benchmark from 1770 ms to 540 ms. Total analysis time is also
down the similar value.
R=brianwilkerson@google.com
Change-Id: Ia307b33ddd36f8f7e88c0f909422b980d3c67dda
Reviewed-on: https://dart-review.googlesource.com/77481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Change-Id: I38f390abd2c409694ad15cbc35654ba5dab9b9ce
Reviewed-on: https://dart-review.googlesource.com/77015
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: I116eb4b3ce03ae50d8b314531e0b463d4fe58649
Reviewed-on: https://dart-review.googlesource.com/77362
Commit-Queue: Peter von der Ahé <ahe@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
We don't want to recreate these scopes.
R=brianwilkerson@google.com
Change-Id: I006c59af558e5f39c20e36811c17da05f5641818
Reviewed-on: https://dart-review.googlesource.com/77264
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This makes the benchmark I'm using now about 15% faster.
The benchmark keeps unlinked and linked summaries in ByteStore.
After computing errors, it removes *.resolved keys.
So, the next cycle only reads file contents, performs resolution,
and computes errors.
This helps to make profiling results more focused.
Before: Computed errors in 28202 ms.
After: Computed errors in 24025 ms.
/Users/scheglov/Source/flutter/examples/flutter_gallery
R=brianwilkerson@google.com, paulberry@google.com
files: 708
/Users/scheglov/Source/flutter/examples/hello_world
files: 49
/Users/scheglov/Source/flutter/examples/stocks
files: 69
/Users/scheglov/Source/flutter/packages/flutter
files: 911
/Users/scheglov/Source/flutter/packages/flutter_test
files: 34
/Users/scheglov/Source/flutter/packages/flutter_tools
files: 416
Change-Id: Ibcc36d60d6ffbab064e96fad5e44ed0a9bfcb929
Reviewed-on: https://dart-review.googlesource.com/77242
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
We don't really need to check that the corresponding resource is
a file. Now it is a file, or a directory, the moment later it is not.
We will try to read it, if we can - fine, if not - it does not exist.
This makes my Flutter analysis benchmark about 3% faster.
R=brianwilkerson@google.com
Change-Id: I955be276c7a694a408c70f8f2d47dce75594ebc8
Reviewed-on: https://dart-review.googlesource.com/77243
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
TFA is improved to detect if a method was called using dynamic selector,
was ever called not via this, and whether the tear-off was taken.
This information is used to remove parameter type checks in AOT.
Less accurate selector-based analysis, which was used previously to get
this information, is now used only if TFA is disabled.
Also, precompiler is improved to omit method extractors and implicit
closure functions if analysis proved that tear-off is not taken.
Flutter gallery snapshot size: -0.8%
Change-Id: Iec01257dfdc78104752104df14e2ce078d326a96
Reviewed-on: https://dart-review.googlesource.com/77005
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
It costed us about 1.2% of total analysis time.
The whole information about a unit is available in its Source.
R=brianwilkerson@google.com
Change-Id: Iffa253d1eae1a466c10766f66c6c677e19be124a
Reviewed-on: https://dart-review.googlesource.com/77220
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
I'd like to use these non-APIs in my benchmarks.
R=brianwilkerson@google.com
Change-Id: Ia85081dd6ccdfed9478a34459aadc8e802ff1072
Reviewed-on: https://dart-review.googlesource.com/77161
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
TBR
This does not fix Windows bot, but I think will help for the Mac one.
Change-Id: I13d7914e60492e4865827e6c06359440aeeff29a
Reviewed-on: https://dart-review.googlesource.com/77221
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This allows us to avoid performing normalization, and work with paths
as is. So, this speeds up SourceFactoryImpl.restoreUri() from 7.5% to 3.7%
R=brianwilkerson@google.com
Change-Id: I085f3db40af6543fbb524a82fad48aa051e87937
Reviewed-on: https://dart-review.googlesource.com/77017
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This updates the parser to recover when
* 'extend' or 'extends' is used rather than 'on' in a mixin declaration
* 'extend' or 'on' is used rather then 'extends' in a class declaration
This also introduces a new ExpectedInstead error message to better
communicate to the developer the keyword that should be used.
Fix https://github.com/dart-lang/sdk/issues/34563
Change-Id: Iafcb3d18db8ca3898c1e4dae74e5124c108ead48
Reviewed-on: https://dart-review.googlesource.com/77140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Change-Id: I20f8ab79a8dbe6f2604f64cc26c2a91f46fcd2c2
Reviewed-on: https://dart-review.googlesource.com/76600
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Change-Id: I6f9741c545c554ecdb62a19aeb85562213b86b13
Reviewed-on: https://dart-review.googlesource.com/76601
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
This is currently unused. We might eventually resurrect it in some
form, but for now it is not doing anything for us.
Change-Id: Ib029fa8589b345bcf44a048a8c492fce9717e034
Reviewed-on: https://dart-review.googlesource.com/77061
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Change-Id: Ie89b41be2d07bc7ca1a53dc691d0fcf71a7ee0dc
Reviewed-on: https://dart-review.googlesource.com/77040
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
This regressed in https://dart-review.googlesource.com/c/74664/.
In Analyzer FunctionType.typeFormals returns TypeParameterElements
instead of TypeParameterTypes; it is not safe to assume non-null bound
for elements.
Also fixes & clarifies the intent of _canEmitTypeAtTopLevel (formerly
_typeIsLoaded). There was no reason to visit the typeFormals, as generic
function types can always be emitted into the module.
Change-Id: Ia8b9271c2d1b66dca934d032dcbbe4fe89146f1b
Reviewed-on: https://dart-review.googlesource.com/76746
Reviewed-by: Alan Knight <alanknight@google.com>
Profiler showed that it was about 5% of total Flutter repo analysis time.
R=brianwilkerson@google.com
Change-Id: I172b93aaf4c25dec2de7798249984f2ef493807c
Reviewed-on: https://dart-review.googlesource.com/77008
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
When we need to check that the concrete implementation is valid for
the class interface, we already know whether we have the required
concrete implementation, or if it is left abstract. So, we can report
corresponding errors without additional computation.
R=brianwilkerson@google.com
Change-Id: Ib6d19bab024572c26853c16f22adb8a545a2e304
Reviewed-on: https://dart-review.googlesource.com/77006
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This CL updates dartfix to make the recommended changes after
prompting the user to confirm that these changes should be made.
If the source contains errors that might affect the correctness
of the automatically applied fixes, then a warning is issued
before prompting the user.
This CL also addresses comments in
https://dart-review.googlesource.com/c/sdk/+/77020
Change-Id: Ie609247616dd033aa16af8d7e6e38a9eb4cbf0d0
Reviewed-on: https://dart-review.googlesource.com/77021
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Also fix#34360 by addressing a few remaining Analyzer issues.
Change-Id: Iac3d9ba72aa370846fced3654a376899b5938152
Reviewed-on: https://dart-review.googlesource.com/76343
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This CL fixes some bugs and regressions in the 'fasta testing sdk' tool:
* Plugs the excessive memory leak in suite.dart (thanks to jensj
for helping tracking it down)
* Fixes the signature of MultitestTransformer.bind such that it no
longer causes a type error to happen at runtime.
* Removes the code that disallows test name "none".
* Updates the exclude list in testing.json
Change-Id: Ie850139c2228550c9847883d4fdaed839a052200
Reviewed-on: https://dart-review.googlesource.com/76840
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Change-Id: I0f942389f52b8302bac8b1bd0cedee1e35811056
Reviewed-on: https://dart-review.googlesource.com/76940
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Allow super calls to occur in mixin declarations if they target a
method from any of the superclass constraint interfaces.
Instead of compiling the Dart mixin declaration
mixin M on S0, S1 {...}
to Kernel:
abstract class _M&S0&S1 = S0 with S1;
abstract class M extends _M&S0&S1 { ... }
we compile it to Kernel:
abstract class _M&S0&S1 implements S0, S1 {}
abstract class M extends _M&S0&S1 { ... }
because the former is not symmetrical with respect to S0 and S1. It
will prefer a method from the 'mixin' S1 over one from S0 which can
give a compile-time error if the method from S0 is more general.
Modify mixin inference to support the new compilation of mixin
declarations. It still has to support old-style VM super mixins until
support for those is removed from the VM.
Change-Id: Ib945aa11cc19c457b07bc802beae10d1663ff6b7
Reviewed-on: https://dart-review.googlesource.com/76141
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
This normalizes all accesses of Object properties on dynamic receivers
to target the corresponding Object members.
CFE already set the interface target on for instance `a == b` where `a`
has static type `dynamic` but didn't for the implicit call to `==` in
for instance `a?.b`.
Change-Id: I4f714766ac33a431f5ef645df7ee1bbb254c06ce
Reviewed-on: https://dart-review.googlesource.com/76123
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
- including the first benefit: Removing Class/Member definitions from the K-world.
Change-Id: I440dce2e37758dd276a417851f67a1403f6535a0
Reviewed-on: https://dart-review.googlesource.com/76641
Reviewed-by: Sigmund Cherem <sigmund@google.com>
`dartdevc --kernel` is now equivalent to the old `dartdevk` command.
This will make migration easier, as it's now just a flag to enable
CFE/Kernel. `dartdevk` is now deprecated, but it can be supported for
a while as it just calls `dartdevc --kernel`.
Change-Id: Ib8d09f74556740a3af11c753f80cd87bd4a09044
Reviewed-on: https://dart-review.googlesource.com/76566
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
The new argument order matches the runtime call and requires less copying.
Simplify Function::HasCode()
Remove obsolete workaround when updating type test cache.
Change-Id: I57c988f97ee2259a22730f445f336cd2a085959e
Reviewed-on: https://dart-review.googlesource.com/76584
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Refactor it.
Use Name object to check that a particular member is accessible in
a particular library.
R=brianwilkerson@google.com
Change-Id: Id057e9336da8e8f97adedd1256a69ca3de267414
Reviewed-on: https://dart-review.googlesource.com/76585
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This was inadvertently left out of the initial implementation.
Change-Id: I930bb77baad2e10e61836c15453729711d54cbde
Reviewed-on: https://dart-review.googlesource.com/76724
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
In a later CL I will add code to print out the errors in the case
where the front end detects errors but the analyzer does not.
Change-Id: I675a9ffcce7cfe7afa32406b3310e7b1d42d2afc
Reviewed-on: https://dart-review.googlesource.com/76720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
We take a slight performance hit when differences are actually found
(since we now check for differences first, and then compute the diff
afterwards if differences were found), but this shouldn't be a big
problem since most of the time there are no differences.
Change-Id: I62957bc7ea3ef2e87afdf7ea175ea5e4e75fc1aa
Reviewed-on: https://dart-review.googlesource.com/76703
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
We should delete this code once Flutter switches to the new mixins.
R=brianwilkerson@google.com
Change-Id: Ib57d9093dade0d926386647f47f91918e92a51f2
Reviewed-on: https://dart-review.googlesource.com/76700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Also accept `#` in fragment.
Fix bug in parsing URI where first character of path needs escaping.
The characters are escaped, but parsing doesn't fail, like it previously
did on misplaced general delimiters in those places
Fixes#34451.
Bug: https://dartbug.com/34451
Change-Id: I99aa39bd2909661802ad9d1bb5dada94d579141b
Reviewed-on: https://dart-review.googlesource.com/74780
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Also disable colors unconditionally.
Change-Id: Ib69777267c4f41595634c6f28c71d4db9c96feb9
Reviewed-on: https://dart-review.googlesource.com/76668
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
Prior to this CL the return type of any constructor function was
always void. According to the specification §9.3 the return type of a
constructor function ought to be its enclosing class.
Change-Id: I70d76cc354b7f118ce96bf4954daf7fe535eb7be
Reviewed-on: https://dart-review.googlesource.com/76160
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Change-Id: I4a6732bcce9ddb98cd00e60e8d46fae1dd4b9599
Reviewed-on: https://dart-review.googlesource.com/76500
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
This change expands typedefs into their underlying function type in the
compiler. Typedefs no longer exist at runtime in DDC, so they now have
similar equality and identity behavior as other function types.
The compiler used to preserve typedefs so they could have a better
toString. But over time that support has been almost entirely lost;
the caching for function/interface types eliminates typedefs, and
DDC+Kernel does not appear to get any TypedefTypes from the common
front end. So in practice typedef types were almost never present at
runtime. Because of this, we can remove the remaining support with very
little user visible effect. This also brings DDC's canonicalization
roughly in line with dart2js for compile-time typedefs, so frameworks
like Angular will be able to continue their use of `identical` for fast
type comparisons.
This CL also fixes DDC's type caching for generic function types
(typeHashCode was incorrect for them), and has some refactoring to
improve names/comments and make the SDK runtime code more clear.
Change-Id: I4e34c0c8f737a8535ba474a4683967ff41bcd3c8
Reviewed-on: https://dart-review.googlesource.com/74664
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Alan Knight <alanknight@google.com>
This is a redo of "[dart2js] Simplify noInline / tryInline annotations"
but keeping compatibility between different versions of dart2js and package:meta
Change-Id: I30e48f374aeef13d99f41af81eb0b8f339ab8bb8
Reviewed-on: https://dart-review.googlesource.com/76581
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
This required adding an implementation of super-bounded types to the
analyzer.
We really could use some more tests to verify that we disallow
super-bounded types in all the appropriate locations, but allow it in
other cases (it seems that there are no language_2 tests to verify
this). To avoid churn, I'll wait until I have confirmation that my
reasoning is correct in #34583 before submitting test cases.
Fixes#34532.
Fixes#34560.
Change-Id: I3c5def60bcac0d31b56bead31cb1aab445f18e96
Reviewed-on: https://dart-review.googlesource.com/76280
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
- avoids creating a second analyzer summary resynthesizer
- avoids creating a new class hierarchy
Change-Id: Idd9e2952f1ab46b2a5d58bbc40fa2be5c1604d5e
Reviewed-on: https://dart-review.googlesource.com/76062
Reviewed-by: Alan Knight <alanknight@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Type inference for final fields in precompiler.cc is limited and
does not properly handle constant objects.
This change hooks up field types inferred by TFA and removes the
inference in precompiler.cc.
Fixes: https://github.com/flutter/flutter/issues/22131
Change-Id: Ida65cd211074623928bb2a7d48dc58d5e53511b8
Reviewed-on: https://dart-review.googlesource.com/76562
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This reverts commit 8bae3a1cfd.
There are versioning issues that need to be addressed.
TBR=kevmoo@google.com
Change-Id: Ia82e94f127523db650e4df03af1179ef94463bee
Reviewed-on: https://dart-review.googlesource.com/76564
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
It's not necessary (because these types are already set correctly by
the summary linker) and it causes incorrect behavior (because due to
issue #34579 the AST nodes don't always contain correct types).
This reduces the severity of #34579 by ensuring that the incorrect
types stay in the AST nodes and don't leak into the element model.
I'll leave that issue open to remind us to make a more complete fix.
Change-Id: Ibf39370d501b5e19c9dc75713f2c39ca732870d6
Reviewed-on: https://dart-review.googlesource.com/76441
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Before, a duplciated declaration would cause the compiler to abort using
deprecated_InputError.
Change-Id: Ide8d13802045e9a349f0f408a6d174a47c7f6418
Reviewed-on: https://dart-review.googlesource.com/76122
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Change-Id: I558827417c938a22075c5b5357294d27cbd6286a
Reviewed-on: https://dart-review.googlesource.com/76121
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
This speeds up the computation of static type by avoiding repeated
visits of subtrees. The change also paves the way for improving
static type computation beyond what is specified. For instance by
handling negative type promotions.
Change-Id: Ifa3ea0f9760251f43cbbcc97b684004741a97b11
Reviewed-on: https://dart-review.googlesource.com/76020
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>