Konstantin Shcheglov
bb5b37eb5f
Flow analysis is not available outside of function bodies and initializers.
...
This fixes a group of crashes during fuzz testing.
FAILURE: typedef`(=<?[
[NoSuchMethodError: The method 'nullAwareAccess_rightBegin' was called on null.
Receiver: null
Tried calling: nullAwareAccess_rightBegin(Instance of 'ListLiteralImpl', Instance of 'InterfaceTypeImpl'), #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
#1 ResolverVisitor.startNullAwareIndexExpression (package:analyzer/src/generated/resolver.dart:776:26)
#2 ResolverVisitor.visitIndexExpression (package:analyzer/src/generated/resolver.dart:1585:5)
#3 IndexExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:5993:49)
#4 DefaultFormalParameterImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:3008:20)
#5 ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:1743:10)
#6 UnifyingAstVisitor.visitDefaultFormalParameter (package:analyzer/dart/ast/visitor.dart:3198:65)
#7 ResolverVisitor.visitDefaultFormalParameter (package:analyzer/src/generated/resolver.dart:1239:11)
#8 DefaultFormalParameterImpl.accept (package:analyzer/src/dart/ast/ast.dart:3003:15)
#9 NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7611:20)
#10 FormalParameterListImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:4493:17)
#11 ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:1743:10)
#12 UnifyingAstVisitor.visitFormalParameterList (package:analyzer/dart/ast/visitor.dart:3258:59)
#13 ScopedVisitor.visitFormalParameterList (package:analyzer/src/generated/resolver.dart:2717:11)
#14 FormalParameterListImpl.accept (package:analyzer/src/dart/ast/ast.dart:4489:49)
#15 FunctionTypeAliasImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:5166:18)
#16 ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:1743:10)
#17 UnifyingAstVisitor.visitFunctionTypeAlias (package:analyzer/dart/ast/visitor.dart:3285:55)
#18 ScopedVisitor.visitFunctionTypeAliasInScope (package:analyzer/src/generated/resolver.dart:2819:11)
#19 ResolverVisitor.visitFunctionTypeAliasInScope (package:analyzer/src/generated/resolver.dart:1490:11)
#20 ScopedVisitor.visitFunctionTypeAlias (package:analyzer/src/generated/resolver.dart:2812:7)
#21 ResolverVisitor.visitFunctionTypeAlias (package:analyzer/src/generated/resolver.dart:1482:13)
#22 FunctionTypeAliasImpl.accept (package:analyzer/src/dart/ast/ast.dart:5158:49)
#23 ResolverVisitor.visitCompilationUnit (package:analyzer/src/generated/resolver.dart:1088:23)
#24 CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:2134:49)
#25 LibraryAnalyzer._resolveFile (package:analyzer/src/dart/analysis/library_analyzer.dart:706:10)
Continues //dart-review.googlesource.com/c/sdk/+/175187
Change-Id: I9518363961b4adcf7f57c2f0661151ef74efc2f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175906
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-12 17:05:32 +00:00
Sam Rawlins
140afeebc8
analyzer: Prepare some APIs for null safety; specify returns more accurately
...
Change-Id: Ia71bf5958d28c4229f68c0a1612cf44a2f283419
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175903
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2020-12-12 17:05:10 +00:00
Konstantin Shcheglov
dd8401ac16
Don't write initializers of static final fields.
...
This was causing one of the new crashes in summaries.
Change-Id: I50e33a83d680070d1863f27b8ee276163b84c9d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175905
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-12 07:27:40 +00:00
Konstantin Shcheglov
3d67e6f998
Migrate _fe_analyzer_shared to null safety.
...
Some notes.
1. `Token.next` is `Token?` because there are null(s) for comment tokens.
But I think that it is never `null` in code, because there is at
least EOF token. So, lots of `!` null checks.
2. `Link.tail` is never null when `isNotEmpty`, but the type system
cannot express it. So, some number of `!` null checks.
3. I keep assert(s) for now, and use comment
`// ignore: unnecessary_null_comparison`.
4. I disabled `can_get_rid_of_nnbd_issue_error`, I think it fails
because of changes in `_fe_analyzer_shared` language version.
Smoke test in google3 looks green.
https://test.corp.google.com/ui#id=OCL:346825148:BASE:346841611:1607632317129:6e87bf7
I have not tried yet full TAP, will do in the evening.
I have not tried yet Golem, or looked at benchmarks.
Change-Id: I651301e5d3a851dd77d73af960dac779cb0fc991
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175620
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2020-12-12 03:22:29 +00:00
Konstantin Shcheglov
1b337c5762
Fix crash in VarianceBuilder when more type arguments than type parameters.
...
R=brianwilkerson@google.com
Change-Id: Iffdae11f93a68ad5a63c0f3b08b8f087423b0d84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-11 23:20:29 +00:00
Konstantin Shcheglov
15a533f0ac
Add tests for non-function type aliases that end with question types and classes.
...
Change-Id: Id56f2e8dec535e5c7af081bf7b94c759027cac6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175865
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-11 21:04:39 +00:00
Konstantin Shcheglov
96552d2524
Replace LibraryContext.loadedBundles.add with ElementFactory.
...
Change-Id: I6171e0b738d854d6065591b08bf76c261bfaf6f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175823
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-11 16:54:20 +00:00
Konstantin Shcheglov
60ec210866
Add debug data to ApplyResolutionVisitor.
...
R=brianwilkerson@google.com
Change-Id: I4873d3101457b1287af59c61781c72e220cc9437
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175800
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-12-11 00:49:58 +00:00
Sam Rawlins
69cb9f7a67
Analyzer: Remove legacy parser (replaced by Fasta).
...
* Replace most of the implementation of Parser with the implementation
found in _Parser2, which uses Fasta.
* Rework Parser constructor to do exactly what the previous factory
constructor + _Parser2 constructor did.
* Remove _Parser2 and ParserAdapter.
* Remove `useFasta` argument in several places.
* Delete tests in parser_test.dart which only used the legacy parser.
* Move ParserProxy from parser_fasta_test.dart to parser_test.dart
* Remove ~240 cases of dead code like `if (useFasta)` and `useFasta ?`
in tests.
Change-Id: Iea29a10ff83103293902336490fbc9cd46cd20ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175560
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-12-10 23:47:48 +00:00
Sam Rawlins
fc80294c89
analyzer: Remove two unused parameters from _checkForMissingReturn
...
Change-Id: Iaef99649f95f8b90bd2844fe5ca8a1ad16d981e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2020-12-10 19:53:07 +00:00
Sam Rawlins
1b130f47c1
Analyzer: Prepare some manually lazily initialized fields etc for null safety
...
* Add `/*late final*/ hints for fields which are manually lazily
initialized in a public getter.
* Switch List(size) constructor with [] list literal.
* Force a few non-nullable types.
* Remove `null` assignments in embedder_tests.dart which change type of
fields.
* Remove `null` Tokens in tests where null should not be.
Change-Id: I260657d222f6b8ca10e31d06991dc9e2cb575e5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171140
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-12-10 01:14:48 +00:00
Michal Terepeta
97093b2594
Watch Bazel generated files for changes
...
This introduces a way to see what paths have been searched for by
the `BazelWorkspace` and adds a polling-based watcher to detect
when files generated by Bazel appear (or have changed). This allows
us to re-analyze things automatically instead of, e.g., restarting
the server.
Change-Id: I60eae29b0e4fcc3a91d8d2275c6898e45548ea03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168649
Commit-Queue: Michal Terepeta <michalt@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2020-12-09 09:39:19 +00:00
Konstantin Shcheglov
2c7de33476
Report TYPE_ALIAS_CANNOT_REFERENCE_ITSELF for non-function type aliases.
...
Change-Id: I9ebcae63f4a5b708f25f9f41c5733ea701350a42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175384
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-09 06:02:48 +00:00
Konstantin Shcheglov
a2d488123c
Implement support for accessing static member when aliased type is InterfaceType.
...
Change-Id: Ia86338b409e0ee6f812924966a0d0eebf29597c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175421
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-09 02:19:08 +00:00
Konstantin Shcheglov
2cf24e3b57
Evaluate TypeAliasElement in ConstantVisitor.
...
R=brianwilkerson@google.com
Change-Id: I53ce1ed1b838c0c2a3c977f9be930733b951547a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175383
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-08 21:13:35 +00:00
pq
60bec731a0
@doNoStore fixes for function expressions
...
Fixes: https://github.com/dart-lang/sdk/issues/44425
Change-Id: I5bac77d9a2961750b0037cd1d464ae059bcbe886
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Phil Quitslund <pquitslund@google.com >
2020-12-08 21:01:55 +00:00
Danny Tuppeny
0fa6674ea9
[Analyzer] Include required-named params in defaultArgumentListString and LSP complete-function-calls
...
Change-Id: I8b4c09305df6e868e7447c538be4a3b540aa7e57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174802
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-12-08 20:47:04 +00:00
Konstantin Shcheglov
dbe003f6af
Update AstRewriter to support non-function type aliases.
...
R=brianwilkerson@google.com
Change-Id: Id2bca0b3c8603fceea18628286412fea5a4598de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175382
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-08 20:46:25 +00:00
Konstantin Shcheglov
ef09410def
Remove ElementImpl.getChild()
...
It is not used internally or externally (and not API).
Change-Id: Ia35bfe2ea83e1da5ae4b7945220e2b1a31c88da8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175326
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-08 17:33:45 +00:00
Konstantin Shcheglov
1c864b1bc7
Fix for StackOverflow in FileState.library
...
Change-Id: I6dd9ceefbfa8d5f457d69ae20838290b8a208c98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175329
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-08 17:26:54 +00:00
Konstantin Shcheglov
f508063f9c
When performing partial resolution for Cider, set the context.
...
R=brianwilkerson@google.com , keertip@google.com
Bug: https://buganizer.corp.google.com/issues/175007667
Change-Id: Ia1f38a8016a5580cd26bf30716affce5bc386f43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175325
Reviewed-by: Keerti Parthasarathy <keertip@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-08 05:19:43 +00:00
Konstantin Shcheglov
8d01debeda
For interactive use case in AnalysisDriver use separately stored ASTs for files.
...
Change-Id: I92ee458a6c143a3164c0b5a10adf42c4dbe4878d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175282
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-08 00:58:18 +00:00
Konstantin Shcheglov
ded707e265
Update latestSdkLanguageVersion to '2.12'.
...
Change-Id: I4b06f02dfecf9e10bca7fb0b285527c80d76166e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175281
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-12-07 18:40:54 +00:00
Konstantin Shcheglov
1231658f99
Add 'redirectedConstructor' to unit API signature.
...
ConstructorElement.redirectedConstructor exposes this data, so we
should include it into the signature.
Change-Id: I87d339589694b63709f722f6b5242fb95c1085d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175220
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-07 17:28:58 +00:00
Lasse R.H. Nielsen
6e29700e16
Update List constructor documentation, deprecate constructor.
...
Emphasize that the operation is going away,
and mark constructor as deprecated.
TEST= Refactoring+deprecation only, covered by existing tests.
Change-Id: I82aa044cd2cf7bf347b624371399f44bda8f4a07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173261
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Nate Bosch <nbosch@google.com >
2020-12-07 16:20:28 +00:00
Brian Wilkerson
7316f346e3
Update the highlighting for private_optional_parameter to include only the parameter name
...
Change-Id: Ie04c30d4d3db7aa9f6804097c8a5a0fd78854756
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175200
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2020-12-07 15:28:37 +00:00
Sam Rawlins
56cf16887c
Analyzer: Don't report on prefixed import with illegal references
...
Bug: TODO from https://github.com/dart-lang/sdk/issues/38784
Change-Id: I4ecdaf333c2613eb5fa0c57e4a8f8be56c35bb21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175184
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-12-07 01:27:25 +00:00
Sam Rawlins
3f8ce51efd
Analyzer: Do not report unused prefixed import when extension is used
...
Fixes https://github.com/dart-lang/sdk/issues/40298
Change-Id: I2fb70249749b3bb086470714e5d1e16e80c30811
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175185
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2020-12-06 19:36:44 +00:00
Konstantin Shcheglov
c9854e3453
Flow analysis is not available outside of function bodies and initializers.
...
This fixes a group of crashes during fuzz testing.
FAILURE: z({=?[
[NoSuchMethodError: The getter 'flow' was called on null.
Receiver: null
Tried calling: flow
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
#1 ResolverVisitor.startNullAwareIndexExpression (package:analyzer/src/generated/resolver.dart:743:21)
#2 ResolverVisitor.visitIndexExpression (package:analyzer/src/generated/resolver.dart:1552:5)
#3 IndexExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:5993:49)
#4 AstResolver.resolve (package:analyzer/src/summary2/ast_resolver.dart:85:10)
#5 DefaultValueResolver._parameter (package:analyzer/src/summary2/default_value_resolver.dart:107:18)
#6 DefaultValueResolver._parameters (package:analyzer/src/summary2/default_value_resolver.dart:121:7)
#7 DefaultValueResolver._function (package:analyzer/src/summary2/default_value_resolver.dart:89:5)
#8 DefaultValueResolver.resolve (package:analyzer/src/summary2/default_value_resolver.dart:47:9)
#9 LibraryBuilder.resolveDefaultValues (package:analyzer/src/summary2/library_builder.dart:313:43)
#10 Linker._resolveDefaultValues (package:analyzer/src/summary2/link.dart:230:15)
#11 Linker._buildOutlines (package:analyzer/src/summary2/link.dart:89:5)
#12 Linker.link (package:analyzer/src/summary2/link.dart:69:5)
#13 link (package:analyzer/src/summary2/link.dart:33:10)
Change-Id: I6145a1f728d432be8d0fa55235858e091030461c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175187
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-06 05:39:04 +00:00
Sam Rawlins
f1916cf0bb
Analyzer: do not report an undefined getter with an empty name
...
Such code is already reported with parser errors, like missing_identifier.
Change-Id: I7f4cc049aa6129cea84d210ccb4e595e52d96fb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173740
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-12-05 14:39:03 +00:00
Konstantin Shcheglov
dee85df64d
Basic support for elements/types of non-function type aliases.
...
Change-Id: Ide8f2fff98f7f03375efad23df3ed79795c33a23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174681
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-12-04 23:32:02 +00:00
Konstantin Shcheglov
2e67e92e0b
Specialize writing InterfaceType with no arguments.
...
This saves 124KB, or about 6% on SDK summary.
Change-Id: I7715136c069d71c6a4cafbd2d622c5d0aa2b81f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175162
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-04 23:15:52 +00:00
Konstantin Shcheglov
a230d059e1
Add LinkedUnitContext.element, remove TODO for BooleanLiteral.
...
I tried to do BooleanLiteral, it resulted in just 1500 bytes saving
for the SDK summary, so I think it is not worth it.
Change-Id: I01cccb67be67ccd33219400a7ecf414d310a201f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-04 22:30:33 +00:00
Konstantin Shcheglov
584a1aca16
Fix a couple of TODO in LinkedUnitContext.
...
R=brianwilkerson@google.com
Change-Id: I8415e6f4e4d7cf68b7ea2484637cf6cc34129669
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175107
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-04 21:59:22 +00:00
Konstantin Shcheglov
4ddbbcbf99
Optimize serialization format for ExperimentStatus.
...
This reduces SDK summary size by 23KB.
Change-Id: I4e59e0be55927198b566d74d6287bab97e1edfa1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175105
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-04 21:53:42 +00:00
Paul Berry
6a097edc48
Flow analysis: allow identical to promote values to non-nullable.
...
This change causes `identical(x, y)` to be treated similarly to `x ==
y` for flow analysis. For example:
int? x = ...;
if (!identical(x, null)) {
print(x + 1); // Ok, x is known not to be null.
}
Fixes https://github.com/dart-lang/language/issues/1226 .
Bug: https://github.com/dart-lang/language/issues/1226
Change-Id: If2939d3d4dd0dc9d7aaf39984045e9ec3e10ce7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174760
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2020-12-04 14:40:15 +00:00
Konstantin Shcheglov
416329dafd
Issue 44284. Fix LUB to consider also mixins.
...
Bug: https://github.com/dart-lang/sdk/issues/44284
Change-Id: If1c67dbe4c5be38dd715ca4aa5a1fc82c0911e36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174820
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-03 17:32:43 +00:00
Sam Rawlins
e0ebe30190
analyzer: Improve unused_import analysis for shared prefix names
...
Fixes https://github.com/dart-lang/sdk/issues/38784
Change-Id: I42b32261e9ed71018967e228d2ec731a4613205d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147336
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-12-03 04:00:37 +00:00
pq
0d145f836b
posix path validation
...
Fixes: https://github.com/dart-lang/sdk/issues/44358
Change-Id: Iaa3e998148f0231dfce14e23cf91b9c721f439b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174600
Commit-Queue: Phil Quitslund <pquitslund@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-12-02 02:36:57 +00:00
Konstantin Shcheglov
2dd03f37c9
Issue 44334. Report DUPLICATE_FIELD_FORMAL_PARAMETER for not final FieldFormalParameter.
...
Bug: https://github.com/dart-lang/sdk/issues/44334
Change-Id: I4f70daf9165e31d3948c210b84aee4c00561bd3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174486
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-12-01 22:05:27 +00:00
Konstantin Shcheglov
f6362881d5
Make 'uniqueName' a field in ErrorCode.
...
It started as a way to speed up IgnoreValidator, becaus computing
uniqueName as a concatenation of 'runtimeType' and 'name' was expensive.
We solved it in a better way, but I think this change is still useful.
Change-Id: I7d3cb8c91f4ca27a0aa3b93f8572cf12c6757bae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174322
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-01 21:41:08 +00:00
Konstantin Shcheglov
19652ae5ad
Use binary format for summaries.
...
Change-Id: Ibf0221a3c233c958e5065b64207faf9dfae33083
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168260
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-12-01 21:30:35 +00:00
Konstantin Shcheglov
b4052982b5
Make documentaiton comments Null Safe by default, support %language directive instead.
...
This is consistent with what we do for user project.
Null safety is not an experiment anymore.
OTOH, any future experiments should be applied on top of the latest
language version.
Change-Id: I6dcbc954aefefb1f7a03c9ceaf1d25be28e7adf4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174488
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-12-01 06:51:44 +00:00
Konstantin Shcheglov
b1a6afba1c
Remove specialized API for Angular analysis.
...
We have removed the Angular plugin, so we don't need the API.
Change-Id: Ifba20fba248b690f429b6a532dc5333a25f5e610
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174400
Reviewed-by: Devon Carew <devoncarew@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-11-30 19:37:24 +00:00
Konstantin Shcheglov
b200c9d68d
Remove functionTypeAlias tests from FunctionTypeImplTest.
...
These tests were passing by a wrong reason.
It is not possible to express a recursive typedef anymore.
When we try to instantiate `G` in `typedef F = G Function()`, it
will instantiate `typdef G = F Function()` right now, directly into
the corresponding FunctionType, but because we are in the process
of setting the return type of `F` right now, `G` is not yet referenced
in `F`, so is not referened by `G` itself.
Such recursion is possible during linking, but then we break it.
We still report errors, and resolved AST still has necessary references.
Change-Id: I47b18f80b00edd01268c65c3e1786892ad0d5091
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174381
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-11-30 19:37:23 +00:00
Konstantin Shcheglov
7ee7f7ad17
Another tweak for FileContentCache.
...
As I see on Golem, now there is a light degradation of performance
for files in the content overlay. This should fix it.
Change-Id: Ic762a646c7dab6cbbd4792cca2c5d3ce1c49edd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174360
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-11-30 00:27:23 +00:00
Konstantin Shcheglov
94a7c94855
Use readAsBytesSync() in FileContentCache.
...
This should be slightly more efficient because we read bytes from
the OS file. We need both bytes (to compute hash) and string (as code).
So, it seems silly to read bytes, decode into string, then again
encode into bytes.
Change-Id: I3ee7c7282cf4f72dc32bcf9b8ffe68899a2ca3c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174341
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-11-29 18:09:53 +00:00
Brian Wilkerson
64105a6a15
Improve the highlight range for for_in_with_const_variable
...
Change-Id: I3dfab4f6748e6e93cd416ee031206896274ff989
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174321
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2020-11-29 05:35:17 +00:00
Konstantin Shcheglov
52fa963f5b
Cache unignorable names for IgnoreValidator.
...
I saw from 4% to 6% analysis time used by IgnoreValidator constructor.
We did quite a few expensive operations each time, for each file.
Now we will do it once for each bucket.
Change-Id: Ia7c79b777269c9e4c10a9fb9f2864cc7249eacf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174230
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-11-28 19:56:36 +00:00
Konstantin Shcheglov
24d7a6feba
Remove unused computePlatformBinariesPath().
...
Change-Id: Ia757016e264f17edbae68abfc14ab5bb33e803cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174228
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-11-28 05:20:51 +00:00