Commit Graph

6018 Commits

Author SHA1 Message Date
Johnni Winther e74c829499 [cfe] Add test for Never in opt-out code
Change-Id: I91683d57e25457e371aaf8f0bb0092426409186e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134526
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-02-06 13:25:51 +00:00
Johnni Winther 80dacdf3a0 [kernel] Add Class.hasConstConstructor and Member.isNonNullableByDefault predicates
Closes #40440

Change-Id: I2776c165d23e2aa2bf5d7515741bd0f0d067b26d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134292
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-02-06 12:27:37 +00:00
Jens Johansen ddd6e31dee [CFE] Allow experimental invalidation to work on DillLibraryBuilders
This CL makes experimental invalidation work on DillLibraryBuilders,
and solves all found issues (e.g. old references (aka leaks)) with it.

Note: This CL introduces a few writes that seems weird (e.g. setting
variables that's about to be out-of-scope to null). This is done to
prevent "leaks", or probably more likely, prevent a "false positive"
leak detection and it currently gives a "clean bill of health" from
the leak detector.

Change-Id: I5b01df6e9ede710a5b624a8a4c21015214140318
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134288
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-06 12:19:51 +00:00
Dmitry Stefantsov af323cfa56 [cfe] Move isTop, isBottom, isObject, and isNull to CoreTypes
Change-Id: I15fbcc5b853e6786244994efef530a96436fb457
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134721
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-02-06 11:56:51 +00:00
Jens Johansen 3371a49964 [cfe] Quick standalone deps calulation
Change-Id: Iee4d7c12f82e4e4692e33fda4b55fd9778a2cf96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/93661
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-02-06 11:10:11 +00:00
Dmitry Stefantsov 11790fe024 [cfe] Warn about non-nullable operands in null-aware operations
Closes #40094.

Bug: http://dartbug.com/40094
Change-Id: I3af5258bf0845257915eb090889fde0fdcb96bf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134339
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-06 11:06:41 +00:00
Johnni Winther 0fe2779149 [cfe] Don't check override for member signatures.
Closes #40460

Change-Id: If418c0c809ec15febfa63c5363f8353cb16fc9de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134521
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-06 08:59:31 +00:00
Dmitry Stefantsov 5f29d40b0f [cfe] Make context of the null-check operator nullable
Closes #37692.

Bug: http://dartbug.com/37692
Change-Id: I2301cf693dc82133681e3969211103bc57880d82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134330
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-05 14:40:39 +00:00
Dmitry Stefantsov 4389ffa9d2 [cfe] Allow member access on Never
Closes #40125.

Bug: http://dartbug.com/40125
Change-Id: I2dcb1bdc022990ba8c76c7798c4e6793c5c89108
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134326
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-05 12:32:09 +00:00
Johnni Winther d826ecc447 [cfe] Use inferred types on forwarding constructors
Closes #40428

Change-Id: I26bf1e21684605d85312c5e808191ad035eb574b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134289
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-05 12:26:49 +00:00
Johnni Winther 88635446ec [cfe] Implement weak mode constants semantics
Closes #40124

Change-Id: Ia54490d9f5162a27e52c4e9c4d74c5cfaa28472b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134284
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-05 07:07:07 +00:00
Jens Johansen f0d16c3c31 [CFE] Parser test for class called late and required
Bug: #40288.
Change-Id: I5be3b949c954e071db4ad5418d23f56fdeb711ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134281
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-04 13:45:31 +00:00
Dmitry Stefantsov 500752d51a [cfe] Disallow default List constructor invocations in NNBD
Closes #40086.

Bug: http://dartbug.com/40086
Change-Id: I56606acfc7c0392f2aece930b1285f69a7594e61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134287
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-04 13:21:31 +00:00
Johnni Winther 89967b83f5 [cfe] Update tests to show that inc/dec shorting is supported
Change-Id: I2c74003cf6bc9ca5dde7e982af053d6e9d54714d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134286
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-04 12:39:06 +00:00
Dmitry Stefantsov 5a8a3ad809 [cfe] Disallow late final fields and const constructors
Closes #40091.

Bug: http://dartbug.com/40091
Change-Id: I9e858ba4de096d230c40c2ff4136b173e46251cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134283
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-04 11:22:11 +00:00
Dmitry Stefantsov 3183573a79 [cfe] Account for signatures when inserting noSuchMethod forwarders
It is possible for an abstract member to be overridden with another
abstract member with different signature (that has, for example, more
optional parameters).  In such cases, the noSuchMethod forwarders should
be generated for each distinct signature.

Closes #40248.

Bug: http://dartbug.com/40248
Change-Id: I7974415f0ecb78f05d7265ecf9d57cc0d38e6c41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132661
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-04 07:58:00 +00:00
Johnni Winther 4d32ec8d21 [cfe] Non-nullify legacy types in opt-in libraries
+ preserve promotion for synthetic variables.

Closes #40255

Change-Id: I2ebe43c31a05ff0121d971205bf8ff5f0e084113
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134161
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-03 14:52:55 +00:00
Johnni Winther 281ce7c14c [cfe] Rename LibraryBuilder.uri to importUri
Change-Id: If576b2b0bca0e27ec63891a53c760d870b2bcd01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133997
Reviewed-by: Jens Johansen <jensj@google.com>
2020-02-03 14:52:55 +00:00
Johnni Winther 3210109ccf [cfe] Detects writes during initialization in late final field lowering
Closes #40219

Change-Id: I8519a35cef96262df0dc68101e43ec5ea8b9de3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133987
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-03 13:40:50 +00:00
Dmitry Stefantsov 5af05598eb [cfe] Disallow non-nullable fields without initializers
Closes #40081.

Bug: http://dartbug.com/40081
Change-Id: I4032af18164af05034c2706cba8f62be39c636c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133994
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-03 13:32:45 +00:00
Johnni Winther 905a380258 [cfe] Handle explicit extension operator access from dill.
Closes #39938

Change-Id: I9798e02c243c1edfbeb1e6f5bb5564bcf9e74a05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133996
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-02-03 12:54:15 +00:00
Johnni Winther 54c8066f6f [cfe] Add new flags to AsExpression and IsExpression
Change-Id: I31eba9b4ced051a1067945fd68e60a09b1fa6ed7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133100
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-31 19:55:22 +00:00
Johnni Winther 42246f7f96 [cfe,analyzer] Disallow type parameters on operator methods
This was never supported by the grammar but unfortunately allowed by
both the analyzer and the CFE.

Change-Id: Id669c934fe08eda41973d6d2cef8340da2e7d72c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133591
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-01-31 14:05:02 +00:00
Jens Johansen dac412d545 [CFE] Don't issue export errors twice in incremental compiler
When loading from dill a library with export errors in it, the errors
would be reported when setting up that scope. There it would be reported
without a location.
Then - if not recompiling it and fixing it - it would be reported again
because of problemsAsJson (with a location).
It would thus be reported twice, one better than the other.

This CL updates the scope building for dill builders to have the option
to supress such errors and then use that option in the incremental
compiler where we use problemsAsJson to reissue problems.

Change-Id: I03430bf8b9996b6e8b7571b8e4e33f3f89f832a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133235
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-31 13:57:32 +00:00
Jens Johansen 94c21123a8 [CFE] Fix memory leak in incremental compiler
Change-Id: I5541707a4a4c7537a947d2b08cb6d3ee4ad6075d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133230
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-31 13:56:41 +00:00
Johnni Winther e0d8aa825a [cfe] Use fileUri in error reporting
+ add support for expectation testing of custom platform libraries

Change-Id: I1dfae23963ec25f2be11fad06c218e1c59fe181a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133920
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-01-31 13:46:22 +00:00
Jens Johansen 3d5530ff22 [CFE] Transformations can now tell of they changed the structure of a class
By allowing a transformation to tell if it change dthe structure of a
class we can make sure to update the class hierarchy accordingly,
making sure it's up to date for the next computeDelta call in the
incremental compiler.

Change-Id: Iefed3bb1ecbd17b142266ce4a9e1e477f9d2fc87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133222
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-31 13:45:12 +00:00
Jens Johansen 3f3d3dfa12 [CFE] Check class hierarchy in incremental compiler test
Change-Id: I963716d36bec213739bbc266f9494885edd0aa08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133104
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-31 10:38:41 +00:00
Dmitry Stefantsov 5e38b59740 [cfe] Don't allow implicit tear-offs of .call on nullable receivers
Closes #39710.

Bug: http://dartbug.com/39710
Change-Id: I3556fac1de1bd6874bbb052e05accebac9619c8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133982
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-31 09:39:21 +00:00
Johnni Winther 178384832c [cfe] Handle unresolved superclass on opt-out class with opt-in platform
Closes #40366

Change-Id: I3452cc825df52009cb294102d99de06c168413f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133782
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-31 08:27:21 +00:00
Johnni Winther 5fb7223b9a [cfe] Handle parameter type inference for mixed inheritance
Closes #39207

Change-Id: Idaac1dcf6980fdebff326002adc466cb06fd0c91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133781
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-30 14:26:38 +00:00
Johnni Winther 7248e98023 [cfe] Support nnbd platform without experiment enabled
All handling of the opt-out features were guarded by the experimental flag.
With this CL the opt-out semantics is used irregardless of the
the experimental flag. This supports compiling with opt-out semantics
against libraries which have been compiled with the flag enabled, as will
be the case when the nnbd sdk is unforked.

Closes #40334

Change-Id: I2df5c700f97844bdd3e33bccba7e72013f0c831e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133780
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-30 12:56:26 +00:00
Johnni Winther e1e0ae5898 [cfe] Demote inferred declaration types
Change-Id: Ibe6709219bd8d9dff80ad260ff8f6025cd74111a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133588
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-30 10:03:25 +00:00
Siva Annamalai 0987024f51 Revert "Implementation of evaluation to JS in frontend server"
This reverts commit 344c584ec4.

Reason for revert: It is breaking the flutter builds and is blocking the roll of Dart into Flutter (see https://github.com/flutter/engine/runs/416355895 and
https://ci.chromium.org/p/flutter/builders/try/Linux%20Host%20Engine/3451)

Original change's description:
> Implementation of evaluation to JS in frontend server
> 
>     - made ProgramCompiler somewhat incremental by letting the user set
>       the current library and class
>     - fixed a bug in procedure_builder where extension method wrappers
>       did not have correct fileEndOffset set, which prevented finding
>       dart scope at a line when extension methods are used
>     - added new compileExpressionToJs API to frontend server and
>       frontend compiler interface
>     - added ExpressionCompier class that combines IncrementalCompiler
>       and ProgramCompiler to compile expression at given dart location
>       to JavaScript
>     - in JavascriptBundle, set the module name for library tracking in
>       JavaScript and saved program compilers to a table for incremental
>       reuse in expression compiler
>     - Exposed generator from IncrementalCompiler for use in
>       ExpressionCompiler
>     - added tests for expression compiler
>     - added test for compileExpressionToJs API in frontend server tests
> 
> 
> Change-Id: Ic5e7829e07030b8ad044da7d35bcf27e9fba81c8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132701
> Commit-Queue: Anna Gringauze <annagrin@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Gary Roumanis <grouma@google.com>
> Reviewed-by: Jake Macdonald <jakemac@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

TBR=aam@google.com,jensj@google.com,johnniwinther@google.com,jakemac@google.com,sigmund@google.com,grouma@google.com,nshahan@google.com,jonahwilliams@google.com,markzipan@google.com,annagrin@google.com

Change-Id: I3dc1ab0117df7b3141b8056ae684fc1c3492b2a3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133867
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-01-30 02:22:40 +00:00
Anna Gringauze 344c584ec4 Implementation of evaluation to JS in frontend server
- made ProgramCompiler somewhat incremental by letting the user set
      the current library and class
    - fixed a bug in procedure_builder where extension method wrappers
      did not have correct fileEndOffset set, which prevented finding
      dart scope at a line when extension methods are used
    - added new compileExpressionToJs API to frontend server and
      frontend compiler interface
    - added ExpressionCompier class that combines IncrementalCompiler
      and ProgramCompiler to compile expression at given dart location
      to JavaScript
    - in JavascriptBundle, set the module name for library tracking in
      JavaScript and saved program compilers to a table for incremental
      reuse in expression compiler
    - Exposed generator from IncrementalCompiler for use in
      ExpressionCompiler
    - added tests for expression compiler
    - added test for compileExpressionToJs API in frontend server tests


Change-Id: Ic5e7829e07030b8ad044da7d35bcf27e9fba81c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132701
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-30 00:54:51 +00:00
Jens Johansen 071210f735 [CFE] Fix expression compilation with extensions
Change-Id: I139b0b7f433fbafbde9cdd0506590fbd98543a3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133587
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-01-29 13:33:41 +00:00
Nate Bosch 833c70be61 Add the first Kernel check for invalid JS interop
Add a visitor that checks for invalid JS interop usage and reports
diagnostics. Wire the visitor up to the `DevCompilerTarget` and `Dart2jsTarget`.

- Add a message without an analyzer code for this error. In the long term we may
  want to also add it to analyzer.
- Add a new package `_js_interop_checks` to share the kernel visitor between
  dart2js and ddc. Some of the code is copied from ddc, and in the long term we
  can centralize more of the detection of JS interop annotations to this
  package.
- Implement the first check to detect definitions of `operator []` or
  `operator []=` which are not allowed in JS interop classes.

Change-Id: I095a4b7f4732796dbc3cae55b32d5fc9bcdbd798
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130733
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-28 22:39:10 +00:00
Jens Johansen 2e9eab5207 [CFE] Don't add newly-converted DillLibraryBuilders to list of needed dill libraries
When d21c4e4fa5 ([CFE] [Incremental
compiler] Convert all SourceLibraryBuilders to DillLibraryBuilders)
landed it also potentially (and inadvertently) changed the "needed dill
libraries" which tracks which libraries - from a dill file - was
actually needed to do that compilation.

Before, only libraries actually coming from a dill file was in this
list.
After, if asking the class hierarchy for information on the
newly-compiled classes, and then asked for the list of needed dill
libraries to be updated (the normal case in DDC) the libraries that was
just compiled (and converted to dill libarries) was added to the list.
DDC in turn tried to attach all marked libararies to the specific
(actual, "physical") dill file it was loaded from, but as those libraries
wasn't loaded from any dill "physical" dill file, it would crash.

This CL fixes the issue by remembering that these are special.

Change-Id: I037ee8f653165d94b5904e4beacc2423801a3461
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133523
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-01-28 13:29:27 +00:00
Johnni Winther 5b47e0fbb7 [cfe] Special case inference of Object.== parameter in legacy mode
Closes #40334

Change-Id: I526ff75a2f135d911f8d555804d03cddc98c3bc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133234
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-28 13:17:37 +00:00
Johnni Winther e7cf75328c [cfe] Update assert to handle extension reexport
Change-Id: Ia7ec03803d86cb69640805ccca1a4f785d0e30e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133238
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-01-28 12:29:57 +00:00
Jens Johansen d7eeaed5dc [CFE] Reproduction and workaround for crash when computing variance
Fixes https://github.com/flutter/flutter/issues/48804.

Change-Id: I3108d102b13cce06dd7582f1f2b8a16aeaa6a6f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131832
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-28 11:04:47 +00:00
Jens Johansen d21c4e4fa5 [CFE] [Incremental compiler] Convert all SourceLibraryBuilders to DillLibraryBuilders
This CL adds another "phase" in the incremental compiler: Convert all
SourceLibraryBuilders to DillLibraryBuilders.
This is done to remedy/fix http://dartbug.com/39840 where the FFI
transformation causes us to crash because theres a differense between
the internal world (SourceLibraryBuilder content) and the external world
(the transformed Library). By converting the SourceLibraryBuilder to a
DillLibraryBuilder the internal world (the builder) is now up-to-date
with any changes done in a transformation step.

This CL does not (at least currently) add a callback mechanism for
transformations so they can say if they changed the structure of the
output. This might still be neccessary as we reuse the (kernel) class
hierarchy and that thus is not (with this change) correctly updated.

Change-Id: Ie659d41c47c2b781753a1606db561e0802fd713f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133065
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-28 09:43:17 +00:00
Johnni Winther bbe5599476 [cfe] Handle promotion of nullable type variables
Change-Id: I5a58cf318bce5bc5342ac6d9f4d197d4e2f46680
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133225
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-27 12:43:06 +00:00
Dmitry Stefantsov d370cabc5e [cfe] Report errors on supertypes marked with "?"
Closes #40087.

Bug: http://dartbug.com/40087
Change-Id: I3b44472f3a778e44a648b0ffd4a5c704b6f4d0c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133220
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-01-24 12:50:09 +00:00
Johnni Winther e4048261c2 [cfe] Compute correct type for read of late lowered variables
+ fix crash on null-aware function call.

Change-Id: Ie2eac4aa21ec615850352e6a5d1292e87f420c9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133102
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-24 12:41:19 +00:00
Johnni Winther 00dc17687a [cfe] Handle late variables in for loops
Closes #40093

Change-Id: I6ed558884f2cf6b10f2d011a80e3f3e15d64b00d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133068
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-01-24 12:41:19 +00:00
Johnni Winther 0a771440dd [cfe] Using isSameType in override checking of bounds
Closes #40220

Change-Id: I2008bcd4c96fb05efad4bd446215cd5710731fce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132846
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-01-24 12:41:19 +00:00
Jens Johansen b2de23d88d [CFE] Messages test doesn't allow status updates for spelling tests
Change-Id: Ic200af202691568dffe5b7578cd9524d8e52c0e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133103
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-01-24 10:15:26 +00:00
Jacob MacDonald 14544a3e2d Allow http uris in frontend_server, front_end, and ddc.
Also updates StrongComponents to prefer the main component as the root if it is in a cycle. This makes bootstrapping more predictable.

This enables a clean integration of build_runner or ddr (internal) and the frontend_server by allowing it to work with any dev server.

All that is needed is a custom .packages file with `http` uris pointing at a dev server which does all code generation, etc.

Bug: https://github.com/dart-lang/webdev/issues/865
Change-Id: I14533d71e5f7ddac58d98073cf016c2589165e9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132962
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-23 23:47:22 +00:00
Dmitry Stefantsov c05e2f1177 [cfe] Report errors on missing default values of optional parameters
The CL also fixes a bug: the required modifier in parameters of local
functions and function expressions wasn't handled.

Closes #40085.

Bug: http://dartbug.com/40085
Change-Id: Ic75fca5870f567ddf2e19aa3a96f83e9117540ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132280
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-23 15:51:37 +00:00