Commit Graph

3034 Commits

Author SHA1 Message Date
Konstantin Shcheglov 5940821f4e Issue 37487. Add CompilationUnit.languageVersion override.
Initial:  https://dart-review.googlesource.com/c/sdk/+/136802
Reverted: https://dart-review.googlesource.com/c/sdk/+/136851

Bug: https://github.com/dart-lang/sdk/issues/37487
Change-Id: Ida3bf049840e7bda32ecdd54309ea0b141aa6800
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137201
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-26 18:08:07 +00:00
Paul Berry b0b06bff31 Revert "Issue 37487. Add CompilationUnit.languageVersion override."
Reason for revert: it was a breaking change to the analyzer public API.

There were two breakages:

- A @required `languageVersion` parameter was added to
  AstFactory.compilationUnit, which is part of the officially
  supported analyzer public API.

- A @required `languageVersion` parameter was added to the Parser
  constructor, which is not part of the officially supported analyzer
  public API, but is part of its de facto public API due to the fact
  that it is used by dart_style.

This reverts commit ce26dfda7d.

Change-Id: I507103ea6f6ffabf915d6f56e9f24454725c3930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136851
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-02-25 04:39:10 +00:00
Konstantin Shcheglov ce26dfda7d Issue 37487. Add CompilationUnit.languageVersion override.
Bug: https://github.com/dart-lang/sdk/issues/37487
Change-Id: I57fbcdd6771d9004ba1fc43902c19514dab2a23d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136802
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-21 20:19:43 +00:00
Konstantin Shcheglov c09e6c18b7 Issue 40538. Verify yield statements using new element type based rules.
Bug: https://github.com/dart-lang/sdk/issues/40538
Change-Id: I9feaca0484f7a5c779068e823bbd765f5c06fe59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136712
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-21 19:26:27 +00:00
Konstantin Shcheglov 561039dd9e Extract YIELD_OF_INVALID_TYPE tests.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I3f57f8d64e08312006ba3cdb81166453d91c867e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136704
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-20 19:02:10 +00:00
Jens Johansen 707ecda05e [analyzer] Add test for bang before type arguments
In https://dart-review.googlesource.com/c/sdk/+/128402 I was asked to
add a test to the analyzer.
This is the (somewhat belated) follow-up that does that.

Change-Id: I7065882b458a480b12d79a4913a59e2bee4f35da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136184
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-02-19 07:45:59 +00:00
Konstantin Shcheglov 21e944f1bc Use promotedBound for TypeParameterType promotion.
Change-Id: I217a8b9140f60d4f6a9ffc052564388c24c1a7ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-18 17:11:44 +00:00
Konstantin Shcheglov 6ae2a011d5 Use named parameters in TypeParameterTypeImpl.
Change-Id: I643acc61f53dfaf2e0c9bec7970fa6c33ff26850
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135964
Reviewed-by: Paul Berry <paulberry@google.com>
2020-02-14 21:19:26 +00:00
Konstantin Shcheglov 5c332bea91 Stop using 'factory something() => null;' in most cases.
I did not change MockSdk, to avoid conflict with
https://dart-review.googlesource.com/c/sdk/+/135241

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/40603
Change-Id: I9f0af20f5914b5ac1aefee02aa8052db269529b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135532
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-12 22:58:57 +00:00
Konstantin Shcheglov b63e3f9425 Replace AnalysisOptions.enabledExperiments with contextFeatures.
There should be just one source of FeatureSet, so that when we add
--default-language-version flag, we apply it to the FeatureSet, and
set as the default for the context.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: If140768bb51db1b0f736b91ab5d624e22100405e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135347
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-11 20:16:14 +00:00
Konstantin Shcheglov abf7d1fc08 Issue 40572. Pass Packages to AnalysisDriver.
Just as SourceFactory is given to AnalysisDriver, so should be Packages.
Understanding --packages and discovery in out of scope.

Bug: https://github.com/dart-lang/sdk/issues/40572
Change-Id: Id120fba0f23a4423797fa9976c4cda5ed54dad53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135188
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-11 00:57:45 +00:00
Konstantin Shcheglov 6f6797e745 Add NullSafetyUnderstandingFlag, update APIs to use it.
DartType.== implementations ignore nullability if the flag is not true.

TypeSystem APIs eliminate nullability from types before doing anything.

Internally analyzer continues using actual nullability for types.

Package nnbd_migration opted into NullSafetyUnderstandingFlag.

Bug: https://github.com/dart-lang/sdk/issues/40500
Change-Id: Ifeea28c01adf1dc59ed2da675b4a62c6334d529a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134865
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-07 21:38:06 +00:00
Konstantin Shcheglov c33935faa8 Extract SwitchStatement errors into separate files.
R=brianwilkerson@google.com

Change-Id: I0832e2c4ebc9c2597bba6dc13bb9dcf376888b88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134764
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-06 19:49:42 +00:00
Konstantin Shcheglov a1d232a9b4 Issue 40392. Report SWITCH_CASE_COMPLETES_NORMALLY when switch/case completes normally.
Bug: https://github.com/dart-lang/sdk/issues/40392
Change-Id: I15c80d0667be1c783cb21870b9f92ee98a4f3042
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134245
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-04 17:46:48 +00:00
Konstantin Shcheglov 8378042f19 Extract test for CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS.
Change-Id: I91641cee4320d4d21d121fc0d9494c090cbe2a76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134246
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-04 17:05:38 +00:00
Konstantin Shcheglov 1fff623c19 Use TypeSystemImpl instead of TypeProvider in DartObjectImpl.
We need to be able to use TypeSystemImpl in DartObjectImpl.== to
call runtimeTypesEqual() instead of DartType.==

Change-Id: I2021a0d86a7c304072fd8fee2d1a7e6e979100a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134146
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-03 20:38:46 +00:00
Konstantin Shcheglov d550879d9d Implement runtime type equality.
Change-Id: I603b5147d7d7e6d8e7267be9c861324b575f259d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134041
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-30 22:59:43 +00:00
Sam Rawlins 637a801e64 Use 'enum' and 'mixin' with undefined getters, methods, operators, setters
Fixes #40177

Change-Id: I0b416a4e77d3d1c5afc1712301c5cf1ea4cfc8d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133043
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-01-30 17:01:58 +00:00
Konstantin Shcheglov efdd38b0eb Move tests for MISMATCHED_GETTER_AND_SETTER_TYPES.
Change-Id: I49f0ea4d30fb50be4ecb6b4226081470397d098d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133543
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-28 19:12:08 +00:00
pq 8ebe354ecc fix diagnostic messages for named constructors
Fixes: https://github.com/dart-lang/linter/issues/1986

Change-Id: I67ba3393be48dc39d3bbaaa922542f11b138afae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133244
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-01-24 18:50:13 +00:00
Konstantin Shcheglov eb271d997f Update NNBD_TOP_MERGE for pending updates to the spec.
These changes are not yet in the spec, but it seems that we want
them before we can start using NNBD_TOP_MERGE for merging interfaces.

Change-Id: I4ba0f95b169febd05a2cbc1a50edf342227ee217
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132971
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-23 03:35:11 +00:00
Sam Rawlins e685ff5131 Move UNDEFINED_{GETTER,METHOD,OPERATOR,SETTER} tests to their own files
Change-Id: Iaf5049efdbf887f84d7db1444d5ea7d835a2c967
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132806
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-22 16:32:08 +00:00
Konstantin Shcheglov 1478e48ea5 Issue 39833. Report an error when a function typed formal parameter has question and the experiment is not enabled.
Bug: https://github.com/dart-lang/sdk/issues/39833
Change-Id: I742396890692cef6a5befa58f7717b3971c82257
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-21 21:30:19 +00:00
Konstantin Shcheglov 6525fc9057 Fix for crash: type 'DefaultParameterElementImpl' is not a subtype of type 'FieldFormalParameterElementImpl'
#0      ResolutionVisitor.visitFieldFormalParameter (package:analyzer/src/dart/resolver/resolution_visitor.dart:458:7)
#1      FieldFormalParameterImpl.accept (package:analyzer/src/dart/ast/ast.dart:4123:49)
#2      ResolutionVisitor.visitDefaultFormalParameter (package:analyzer/src/dart/resolver/resolution_visitor.dart:370:21)
#3      DefaultFormalParameterImpl.accept (package:analyzer/src/dart/ast/ast.dart:2999:15)
#4      NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7520:20)
#5      FormalParameterListImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:4451:17)
#6      RecursiveAstVisitor.visitFormalParameterList (package:analyzer/dart/ast/visitor.dart:887:10)
#7      FormalParameterListImpl.accept (package:analyzer/src/dart/ast/ast.dart:4447:49)
#8      ResolutionVisitor.visitFunctionExpression.<anonymous closure>.<anonymous closure> (package:analyzer/src/dart/resolver/resolution_visitor.dart:596:25)
#9      ResolutionVisitor._withNameScope (package:analyzer/src/dart/resolver/resolution_visitor.dart:1275:8)
#10     ResolutionVisitor.visitFunctionExpression.<anonymous closure> (package:analyzer/src/dart/resolver/resolution_visitor.dart:591:7)
#11     ResolutionVisitor._withElementHolder (package:analyzer/src/dart/resolver/resolution_visitor.dart:1253:8)
#12     ResolutionVisitor.visitFunctionExpression (package:analyzer/src/dart/resolver/resolution_visitor.dart:590:5)
#13     FunctionExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:4969:49)
#14     ResolutionVisitor.visitVariableDeclaration.<anonymous closure>.<anonymous closure> (package:analyzer/src/dart/resolver/resolution_visitor.dart:980:27)
#15     ResolutionVisitor._withElementHolder (package:analyzer/src/dart/resolver/resolution_visitor.dart:1253:8)
#16     ResolutionVisitor.visitVariableDeclaration.<anonymous closure> (package:analyzer/src/dart/resolver/resolution_visitor.dart:979:9)
#17     ResolutionVisitor._withElementWalker (package:analyzer/src/dart/resolver/resolution_visitor.dart:1264:8)
#18     ResolutionVisitor.visitVariableDeclaration (package:analyzer/src/dart/resolver/resolution_visitor.dart:971:7)
#19     VariableDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:10408:49)
#20     NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7520:20)
#21     VariableDeclarationListImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:10512:16)
#22     ResolutionVisitor.visitVariableDeclarationList (package:analyzer/src/dart/resolver/resolution_visitor.dart:995:10)
#23     VariableDeclarationListImpl.accept (package:analyzer/src/dart/ast/ast.dart:10506:15)
#24     FieldDeclarationImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:3993:17)
#25     RecursiveAstVisitor.visitFieldDeclaration (package:analyzer/dart/ast/visitor.dart:857:10)
#26     ResolutionVisitor.visitFieldDeclaration (package:analyzer/src/dart/resolver/resolution_visitor.dart:449:11)
#27     FieldDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:3988:49)
#28     NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7520:20)
#29     ResolutionVisitor.visitClassDeclaration.<anonymous closure>.<anonymous closure> (package:analyzer/src/dart/resolver/resolution_visitor.dart:245:22)


Change-Id: I2402751a3b88e9df934a2f6660813826244f827a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131901
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-15 21:10:47 +00:00
Konstantin Shcheglov 96cbfb4a2c Issue 39059. Check for minor / major version overflow.
Bug: https://github.com/dart-lang/sdk/issues/39059
Change-Id: I78a5598b2433d772409a41f7c6e87b32f859c6be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131705
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-14 20:08:13 +00:00
Konstantin Shcheglov d44d7d4573 Extract AssignmentExpressionResolver.
Change-Id: I9a019ba499a12431955bf9ee45bfe0ae375a52f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131488
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-14 18:08:15 +00:00
Konstantin Shcheglov 489c0be893 Extract PostfixExpressionResolver.
Change-Id: I915453f32d65f74e2ec12dd65bd17620bbb7d4ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-12 17:53:24 +00:00
Konstantin Shcheglov 33d468dceb Extract BinaryExpressionResolver.
R=brianwilkerson@google.com

Change-Id: I25ed5c2cea682cd32b324693fc0098dc724d8cb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131203
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-11 17:30:14 +00:00
Jens Johansen 201e6a86e1 [parser] Fix 'late' used as 'var'
Fixes #39858.

Change-Id: Ic2721fc56d184b3d0ad3082a7fa9cc45d6bbf45d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129060
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-01-10 10:46:17 +00:00
Konstantin Shcheglov 3f099b05bd Extract PrefixExpressionResolver.
R=brianwilkerson@google.com

Change-Id: Icaee778f5135a802940d925eb4ea0dbf892e164d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130886
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-09 20:57:02 +00:00
Konstantin Shcheglov a8397d8bac Replace assertElementTypeString with assertType.
TBR, somehow I missed these invocation sites initially.

R=brianwilkerson@google.com

Change-Id: Iaf372750c5cb3b9d1912037a03092e1d487316ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130721
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-01-08 17:51:03 +00:00
Konstantin Shcheglov 5bfabfb4f0 Merge some resolution assertions.
Change-Id: I4a5d79d13d890acd641f302c85c7b0f463a11200
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-08 17:30:35 +00:00
Konstantin Shcheglov e85e203e73 Deprecate DartType.name
Change-Id: If3a967bba976aa78493764513edbb3d406b08d27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130625
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-08 07:00:59 +00:00
Konstantin Shcheglov 39f14a000e Rewrite most getDisplayString() to ElementDisplayStringBuilder.
R=brianwilkerson@google.com

Change-Id: I500d0045873a12d550d9ffe302e066a63ba56660
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130221
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-06 16:43:40 +00:00
Sam Rawlins a325691756 analyzer: Add failing test for #38162
Also move return_of_invalid_type tests to their own file.

Change-Id: Ie02acee903dde7cc498d3ecbb1d9f5b0c1691298
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130006
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-01-06 05:15:29 +00:00
Brian Wilkerson 877d6f745d Improve the range selected for const_constructor_with_non_final_field
Change-Id: I168e92c32b581dffcad25804161b56f4d99c1dd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130300
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-05 23:50:22 +00:00
Sam Rawlins bebc7d3af5 analyzer: Add a failing test for #38188
Also move tests for illegal_async_return_type

Change-Id: Icd76c1ece456470ce734df2ac6628d5aedcd6e8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-01-04 05:21:45 +00:00
Konstantin Shcheglov 4f2a9e083d Resolve MethodInvocation fully in MethodInvocationResolver.
So, it is not separated into ElementResolver and StatisTypeAnalyzer.

Change-Id: I413a71b703ab93304760e1f912c3d55585411397
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130132
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-03 21:40:19 +00:00
Konstantin Shcheglov c913b01ec0 Report error during constant evaluation for ForElement.
R=brianwilkerson@google.com, pquitslund@google.com

Change-Id: Ic87094ed1dcfb4e630e3e62b9ed7e7ec8feab2c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130133
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-03 21:18:59 +00:00
Konstantin Shcheglov 3e961f4e91 Stop using assertHasTestErrors() where possible.
R=brianwilkerson@google.com

Change-Id: I0ab8d2afd27c3a18d4fd49cb0e3864078cc163ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130121
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-03 16:12:49 +00:00
Danny Tuppeny 2678ee01ac Don't include end of comment markers in TODO range
Fixes https://github.com/Dart-Code/Dart-Code/issues/2181.

Bug: https://github.com/Dart-Code/Dart-Code/issues/2181
Change-Id: I670f8f46ef60d09ec3f1fd743084734048f3cfc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129440
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-03 15:48:09 +00:00
Konstantin Shcheglov 8a4404e64b Remove assertTestErrorsWithCodes() and assertNoTestErrors().
R=brianwilkerson@google.com

Change-Id: Ia5e64bfe318a11a87ee24aafca94fad7c7c8beb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130005
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-02 15:32:56 +00:00
Konstantin Shcheglov c7f3020fc6 Extract error reporting from TypeNameResolver.
The extracted code mostly chooses which ErrorCode to report, and
does not do resolution logic itself. So, I think it will make the
resolver itself cleaner to keep it separately.

R=brianwilkerson@google.com

Change-Id: Idc6b652028ddb11913d5cd5c8273299ed94e7079
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129987
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-01 22:29:05 +00:00
Konstantin Shcheglov dce4de0b47 Deprecate assertNoTestErrors() and replace with assertNoErrorsInCode().
Change-Id: I3176e50d6cd86fa0863da5252ce52211a63f50b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129960
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-01 20:40:05 +00:00
Konstantin Shcheglov 99a39abe98 Stop using Identifier in several Scope.lookup() methods.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I400f7c5b14f44fb1e2a8b3d5e52016dcc4924961
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129832
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-01 19:55:55 +00:00
Konstantin Shcheglov 850ca2d410 Add Element.getDisplayString(withNullability), use it in analyzer.
R=brianwilkerson@google.com

Change-Id: Ic4924e19612f2a7713f9a3f2059a880ebff9d2db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129983
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-01 19:01:14 +00:00
Konstantin Shcheglov 7b7d8789ca Use WRONG_NUMBER_OF_TYPE_ARGUMENTS instead of two other equivalent error codes.
R=brianwilkerson@google.com

Change-Id: Ibb5ea7d65df75655eaf2d43fba1110740be39912
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129833
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-31 20:27:03 +00:00
Konstantin Shcheglov 73389e6af0 Remove almost all uses of assertTestErrorsWithCodes().
The only use is assertNoTestErrors(), it cannot be replaced with not
ExpectedError(s) at all, we have 209 tests failing with UNUSED_LOCAL_VARIABLE

R=brianwilkerson@google.com

Change-Id: I19b6e0785e7553c00b130f827b4bb35b0742507f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129831
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-31 19:19:03 +00:00
Konstantin Shcheglov 4e38c9012a Remove 'isNonNullableByDefault' from TypeSystem.inferGenericFunctionOrType
R=brianwilkerson@google.com

Change-Id: Ibdca2d8c762d723ad5847ad99605618db19ad5f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129902
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-31 18:28:13 +00:00
Sam Rawlins f1084cdf0b analyzer: move tests for 10 error codes to separate files
Change-Id: I708b0ae276d7da7247d10b854eeedc52fb69e68e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129829
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-30 04:31:08 +00:00