Commit Graph

624 Commits

Author SHA1 Message Date
Konstantin Shcheglov e41b531a59 CQ. Deprecate 'reportErrorForName', use 'atConstructorDeclaration' instead.
Change-Id: Ife3cdfd53551f12aa1b0dc6a223ae91e248ed33e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383444
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-03 20:22:37 +00:00
Konstantin Shcheglov 30b3f9d0a6 CQ. Deprecate 'reportErrorForSpan', use 'atSourceSpan' instead.
Change-Id: I4324154842ec462acbdda49e09d1a74f147c56f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383443
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2024-09-03 20:14:34 +00:00
Sam Rawlins 0e39ed67e6 analyzer: Expose LintCode as public API, for plugins
Work towards https://github.com/dart-lang/sdk/issues/50986

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Ie5783240e3fc2c9f8076b3efb13f79a3b8fa5000
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375060
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-07-09 22:16:00 +00:00
Konstantin Shcheglov b4e30d1b45 CQ. Deprecate unused static members of AnalysisError.
Change-Id: I46e76defbc9a833a867cc3fa2154635f71a6d085
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371422
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-13 23:39:21 +00:00
Konstantin Shcheglov 31a4bb7f60 DevX. Issue 22915. Show instantiated type alias in diagnostics.
Bug: https://github.com/dart-lang/sdk/issues/22915
Change-Id: I733bcb6021a167825840027df371fd22cfc71ce3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370701
Reviewed-by: Sam Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-10 21:19:08 +00:00
Sam Rawlins cf9a8bb532 analyzer: Move DartLinter to linter package's 'test_utilities'
And rename it to TestLinter.

We also get to remove `LintRule._locationInfo`,which was _only_ used
for testing pubspec-oriented rules.

This DartLinter class is only used in tests and tools of the linter
package, so it's good to move it out of analyzer lib/.

In order to remove `LintRule._locationInfo`, we move the singular
package_names test case to be a reflective test.

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I97b5e79daa07eb3942f5444502473a4ec1e9daf0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369562
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-06-04 17:13:49 +00:00
Konstantin Shcheglov 4f6cca1e1e CQ. Extract package:analyzer/error/error.dart library cycle.
By removing unnecessary references to higher level libraries we
can extract a separate 19 libraries cycle, related to errors. Maybe
later we can break it further.

This reduces the mono-cycle from 295 to 270 libraries.

Change-Id: Id9db12002dba10788b65262d3d7325ad6079ceff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-05-31 20:22:28 +00:00
Konstantin Shcheglov 053fcb92c7 CQ. Make atEntity() consistent - use required target and 'errorCode' formal parameters.
Change-Id: I17defde653f41e83c0ff054a4a498a0dacaccd08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366887
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-05-17 00:12:23 +00:00
Paul Berry 261e1181be Stop creating synthetic identifiers to use as error nodes.
By changing the type of error nodes to SyntacticEntity, we can use
Token objects directly as error nodes, rather than having to wrap them
in synthetic identifiers.

Change-Id: I29c2fec7007766b8bc6103da835093ea326e939b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366420
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-14 21:01:11 +00:00
Konstantin Shcheglov f9d4df6331 CQ. Enable avoid_redundant_argument_values in analyzer/
Change-Id: I8e5f5f6629249d1fdfddcfe87d20680b37198765
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353804
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-02-26 19:55:13 +00:00
Konstantin Shcheglov bd38fbada4 CQ. ErrorReporter, use atOffset() instead of reportErrorForOffset()
Change-Id: I506f71d1e7aa95f1c62fca1746e4a86c78720336
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353782
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2024-02-22 19:51:39 +00:00
Konstantin Shcheglov 106db0d7b4 CQ. ErrorReporter, use atElement() instead of reportErrorForElement()
Change-Id: Ife5f6d04ee7c15e7703db3ad81eb7707c7f00ceb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352053
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-13 17:16:07 +00:00
Konstantin Shcheglov 14a1045f16 Legacy. Deprecate 'withNullability' in getDisplayString() methods.
Change-Id: I688f230f4189cd1fc600e4d34f07f339111c382d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350645
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-07 01:25:38 +00:00
Konstantin Shcheglov 9cca4a1c5e ErrorReporter. Use 'contextMessages' name.
This parameter used to be positional, so name did not matter.
But now it dos.

Change-Id: I1c76c2a3958523299ff9361d299fa449eace9441
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350161
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-05 17:24:28 +00:00
Konstantin Shcheglov 2a88162b84 ErrorReporter. Use atNode() instead of reportErrorForNode().
Change-Id: I118fb7623d3effc3bf4bebdeb586196659e8da88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349630
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-02 01:56:59 +00:00
Konstantin Shcheglov 79cd9a6655 ErrorReporter. Add atToken(), atOffset(), atNode(); use atToken()
We discussed this some time ago, and I found another place where
I would like to report at a `SyntacticEntity`. So, if I'm going to
add something, I can just as well make `ErrorReporter` better.

Change-Id: I46d99e8959c7a5fd700cc2cba775114bfefec04d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349709
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-01 22:32:27 +00:00
Konstantin Shcheglov 3ea570739d Legacy. Deprecate 'isNonNullableByDefault' in ErrorReporter constructor.
Change-Id: Ia05e113115fb29b47ba12fc9bf46c1d4c04721b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349463
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-01 01:51:48 +00:00
pq fe6950eceb enable flutter_style_todos
Change-Id: Ic82963b754404d54e37f5fb03819aebc3fa67954
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336502
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-11-15 23:04:19 +00:00
Sam Rawlins 73ab31b98a analyzer: Move the Source class to be public API.
Deprecate accessing LineInfo, Source, or SourceRange via the
old library (pkg/analyzer/lib/src/generated/source.dart).
Migrate all SDK code to the new library.

Fixes https://github.com/dart-lang/sdk/issues/46420

Change-Id: Ic7c98a5820415c92a457f9fa2756351b05520cd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335382
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-11-14 17:10:37 +00:00
Konstantin Shcheglov 4f7295ad26 Record elements and types parts of missing patterns for AddMissingSwitchCases fix.
Bug: https://github.com/dart-lang/sdk/issues/51985
Change-Id: I48e04e992ccab5cb5dedb5df328ba13ffcf6b560
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-05-09 16:29:20 +00:00
Konstantin Shcheglov 036b8cafad Add AnalysisError.tmp() constructor, deprecate the default one.
Bug: https://github.com/dart-lang/sdk/issues/51985
Change-Id: I1204c71a4c5ea62d32d65662ecb5274dacb0bfae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301730
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-05-08 14:39:29 +00:00
Kallen Tu 4f6ccd9fee [analyzer] Report an error when a subtype of a base or final type is not base, final or sealed.
Change-Id: Ie9c943e6ce7d3b1c746ccd4ee3757886dd619c5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-01 19:01:59 +00:00
Ahmed Ashour bea7045517 [analyzer] add failing test case
Bug #50496

Change-Id: Iaa6007af1b9dbbf7bac3f2ad835dece3eb64b189
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271520
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-12-05 17:37:43 +00:00
Ahmed Ashour 0b5d908221 [analyzer] NOT_ENOUGH_POSITIONAL_ARGUMENTS
To report at the token of the expected positional argument

Fixes #50127

Change-Id: I5eb31c6d354fb15d482c2046f7faaa4505658f4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262603
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-10-11 17:56:11 +00:00
Brian Wilkerson 38581783e6 Generate the list of error codes
Change-Id: I315619a30ac8690e90be2b3a3ad7d849c28f2c05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263441
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-10-10 17:26:00 +00:00
Konstantin Shcheglov 8d1297628a More tests for ExtractorPattern resolution, report errors.
Change-Id: I800f909a1d58e8bebcbfa30e52f09a16906b1e07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263142
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-07 18:35:35 +00:00
Konstantin Shcheglov 5ef329cf74 Report CompileTimeErrorCode.DUPLICATE_VARIABLE_PATTERN
Change-Id: I07cb697c9c517f0d4eb67100f0ae134aa821d25d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263002
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-07 00:16:27 +00:00
Konstantin Shcheglov 57a619bcb7 Report diagnostics for relational patterns.
Change-Id: I1a3e02e36679599e0240f74108a5e91db6269b1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-06 16:33:41 +00:00
Jens Johansen e860cf241b [parser] Empty record
https://github.com/dart-lang/language/pull/2535

Change-Id: I8241119ee858ce39673472056b88c9393799e1a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262600
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-10-06 06:34:58 +00:00
Konstantin Shcheglov 683e2419da Deprecate 'DartType.element2' use 'element' instead.
Change-Id: I6986a058616db489987789cfab09d53a450e3ab5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262666
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-05 16:30:09 +00:00
Sam Rawlins 15be61ed9a Remove INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES warnings
Fixes https://github.com/dart-lang/sdk/issues/49112

It was decided to remove the "override with equal default value"
restriction both for null safe code, and for pre-null safe code.

CFE had never issued this static warning, and her we remove it from
analyzer.

Change-Id: I1244e4fe46da8bb4bd8c3a77ec8beb95811e30a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262267
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-04 18:23:10 +00:00
Ahmed Ashour 6da33ae60f [analyzer] add HintCode.DUPLICATE_EXPORT
Fixes #49439

Change-Id: I511205c6b0960f6b19a2ac45211bc1348568f52c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260703
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-10-03 23:22:18 +00:00
Konstantin Shcheglov c73228abaf Report an error when a variable pattern binds in one branch of logical-or, but not in another.
Only check for if-case is implements for now.

Change-Id: I57d1b8b33fbe2bf7adc848b5d607ff99b878b479
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262101
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-09-30 18:53:26 +00:00
Konstantin Shcheglov e03170035a Deprecate 'get name2', use 'get name' instead.
Change-Id: Iee8ef5fb6700d96c857a22a99dc61dac3da88572
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260443
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-22 02:22:47 +00:00
Konstantin Shcheglov 1aa398d4be Report EXPECTED_NAMED_TYPE_X when not a NamedType is parsed.
Change-Id: Ibebc276777075da12e36642f08291fa9a9f9ac91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260073
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-21 02:24:45 +00:00
Ahmed Ashour 63f69b4756 [analysis_server] add a quick fix for some AnalysisOptionsHintCode
Fixes #49513

Change-Id: Ib4a1b68c95c2f379e8cbdaf62b2b17bf0a25e7b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252580
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-06 18:26:46 +00:00
Ahmed Ashour 17e0f87252 [analyser] add MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL
Fixes #49816

Change-Id: I48f3c21fcf552e21da70cf12adf3671c3f490695
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256840
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-30 20:55:38 +00:00
Jens Johansen cec94a1446 [parser] Empty record types, record types with 1 element
This should bring parsing of record types up-to-date with v1.6 of
https://github.com/dart-lang/language/blob/master/working/0546-patterns/records-feature-specification.md

Also fixes https://github.com/dart-lang/sdk/issues/49826

Change-Id: I3737a72ddee49a957bd55f86cc200fb77f23e2a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256660
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-08-30 11:04:10 +00:00
Jens Johansen a4352d09e1 [parser] Record literals can be const and one-element only
This should bring parsing of record literals up-to-date with v1.6 of
https://github.com/dart-lang/language/blob/master/working/0546-patterns/records-feature-specification.md

Change-Id: If39bb1834137da55ef8bd1923106bbc614ea319b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256461
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-08-30 10:54:08 +00:00
Brian Wilkerson 9d1a877082 Generate diagnostics for invalid field names in record literals
Change-Id: I12ece78e257b1265d86114e8c17e6a8c641559e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256364
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-08-25 17:47:06 +00:00
Brian Wilkerson 2b27d3257b Report duplicated field names in record literals
Change-Id: Ifc5c3a06c7f489b00421f5b1af47df52615694d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256200
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-08-24 16:33:49 +00:00
Sam Rawlins 4fcbbb107a Add CAST_FROM_NULL_ALWAYS_FAILS check
Fixes https://github.com/dart-lang/linter/issues/3605

Change-Id: I5f9a2b127173aa9f2cc6f8fcee9c93e96cb63663
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255149
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-08-16 23:41:02 +00:00
Konstantin Shcheglov cbfad8f802 Deprecate DartType.element, use specific element accessor for InterfaceType, TypeParameterType.
For `InterfaceType` keep `element2` deprecated and define
`InterfaceElement get element2` instead. Most changes are because
of this.

Change-Id: I13b888610fc707438c3c97b676f1460e7fc2b040
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253564
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-08-04 16:18:06 +00:00
Konstantin Shcheglov 01173e2aa2 Deprecate 'name' in AST, use 'name2' token instead.
Change-Id: I867f009dca12208f835199297d2ea85c203c8556
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252566
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-02 16:25:34 +00:00
Sam Rawlins 7280525117 Implement mustBeOverridden annotation and enforcement
Fixes https://github.com/dart-lang/sdk/issues/30175
Fixes https://github.com/dart-lang/sdk/issues/28250

Change-Id: Id9c62448da9ade81258c2ae2355d05117057a8f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252463
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-07-25 22:17:18 +00:00
Konstantin Shcheglov 21d0028643 Resolve augmentation import directives in libraries.
Change-Id: I900d262df4b32698e20907a3bb99e88fbee38d3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252006
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-07-20 17:08:58 +00:00
Jens Johansen 25dcfca3c2 [parser][CFE][analyzer] Function is builtIn keyword
This CL makes `Function` a builtIn keyword instead of a `pseudo` keyword.

See also (and fixes):
https://github.com/dart-lang/sdk/issues/45703
https://github.com/dart-lang/sdk/issues/45704
https://github.com/dart-lang/sdk/issues/45705
https://github.com/dart-lang/sdk/issues/49197

This undoes https://dart-review.googlesource.com/c/sdk/+/195761

This is ~a merge of https://dart-review.googlesource.com/c/sdk/+/195906
and https://dart-review.googlesource.com/c/sdk/+/200080

Change-Id: I8bfee6976d43819fa355de99b3b2429eb67a7cdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249484
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-06-28 14:26:33 +00:00
Konstantin Shcheglov e78399ac52 Issue 23067. Report HintCode.DEPRECATED_EXPORT_USE
It found a few cases for `BytesBuilder` exported from `dart:io`.
I fixed most of them in a separate CL.

But package:flutter (itself only) is clean.

There are a few violations in google3.
I will ignore most of them, and fix a few.

Bug: https://github.com/dart-lang/sdk/issues/23067
Change-Id: Ic89370ad84caa60fd49326c2bc60ad5d927e2264
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248343
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2022-06-18 18:17:40 +00:00
Daco Harkes a855030120 [vm/ffi] Allow struct nesting with looser packing
C compilers don't enforce nesting rules. `dart:ffi` was enforcing these
rules causing issues for binding to C libraries having looser packing
for nested structs than outer structs.

This CL completely removes the error from the analyzer and CFE.
(As an alternative we could have kept a hint/lint, but this might create
more noise than value.)

TEST=pkg/analyzer/test/src/diagnostics/packed_nesting_non_packed_test.dart

Closes: https://github.com/dart-lang/sdk/issues/46644
Change-Id: Iae2d5c885546f7799bc6dea2f8cd7dd508216a0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247382
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-06-09 19:08:43 +00:00
Konstantin Shcheglov 87580fb160 Prevent reporting errors when resolving CommentReference.
Change-Id: I5b9426245bc4c20436b95f7668c331172ed5cc71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243760
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-05-05 16:03:15 +00:00