Commit Graph

12 Commits

Author SHA1 Message Date
Jake Macdonald 5285faad67 add ParameterStyle enum and style getter to FormalParameter, closes https://github.com/dart-lang/sdk/issues/56593
add isConst to constructors, add const and factory keywords to augmentations, part of https://github.com/dart-lang/sdk/issues/56516

Change-Id: I424031e22636678da5c9c428099100bfac748daf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382662
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2024-09-04 20:16:11 +00:00
Erik Ernst 410e9a852a Remove unused type parameter
This CL removes an unused type parameter from a test in _macros.
The type parameter gave rise to a warning from the lint
`avoid_types_as_parameter_names` because it had the same name as a
type in scope (`Declaration`).

The type variable could also have been renamed, but it seems very unlikely that any other part of the system will break because the type parameter has been removed: The function is declared in a test, and nothing in the test depends on that type parameter in any way.

See also https://github.com/dart-lang/linter/issues/5066 for details.

Change-Id: Ibc42c4a758f70564c9fe12f3bf2bfbb72e63e97d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383600
Reviewed-by: Jake Macdonald <jakemac@google.com>
2024-09-04 19:34:36 +00:00
Jake Macdonald 51939f1454 add type parameters when creating augmentations
Bug: https://github.com/dart-lang/language/issues/3922
Change-Id: I9d9f6ce898e16e2ed393ae77f0dbcbf9c75fb56d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372580
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-21 07:57:33 +00:00
Jake Macdonald f4899aa62e skip failing macro test
Bug: https://github.com/dart-lang/sdk/issues/55992
Change-Id: Ib2bfaf980d0edc7ac8a0e2a891983a3294ee1588
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371220
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-06-12 20:59:34 +00:00
Jake Macdonald fac11694b4 Track async microtasks scheduled by macros, and ensure they have all completed before a macro returns.
Does not track certain events such as async I/O, but will refuse to execute the scheduled callbacks when those do complete.

Bug: https://github.com/dart-lang/sdk/issues/55426
Change-Id: Ie81100e9e4dbe49d050bad875cc9b6a65969863d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370120
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-11 21:02:29 +00:00
Simon Binder 78f2e16cc9 Add asInstanceOf to StaticType introspection capabilities
This adds `asInstanceOf` to `StaticType`, which tries to find the
instantiation of a given class so that a `StaticType` becomes a subtype
of it.
To actually make use of that data, the definition of `NamedStaticType`
is expanded to contain information about the resolved type identifier
and the type arguments instantiating the class.

Change-Id: I4f7b05d9e44f5228863ef875545286b5cd7f9a41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348920
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
2024-05-28 10:56:55 +00:00
Konstantin Shcheglov f42b019f43 Macro. Support for 'extendsType'.
Change-Id: Ic913d26b630f2d2f22fd6c4dec25ed27814d9f8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368201
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-24 21:38:51 +00:00
Jake Macdonald 0ee590e954 stop importing util.dart, it isn't supported (imports dart:mirrors)
Change-Id: I1dd4d650ace0866e3ef88655582c7edfcf946d01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368222
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-05-24 21:27:04 +00:00
Jake Macdonald ba9af345c2 fix failing pkg/_macro/test/executor/executor_test
Change-Id: I15040720ae47f28b90064db94b1c08cd9db1484f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368220
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-05-24 21:01:54 +00:00
Jake Macdonald 0d2b01bab3 add extendsType API which adds an extends clause to an existing type
refactors builder implementations to fix some bugs, nested builders go through a separate constructor now which has all required params so we can ensure the parent maps are passed down.

update pubspecs/changelogs for release

Bug: https://github.com/dart-lang/sdk/issues/55425
Change-Id: I5bfe3bea3b7574de83d8b3774e92fd9101325b8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368080
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-05-24 18:16:22 +00:00
Konstantin Shcheglov d0e4ef7e6c Parse 'augment library' instead of 'library augment'.
Bug: https://github.com/dart-lang/sdk/issues/55374

Change-Id: I856c21f4b102fa589f5a14c3d28daf64e4112099
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361286
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-04-08 20:34:30 +00:00
Konstantin Shcheglov 36c0788137 add package:_macros (SDK vendored) and package:macros (pub published)
add sdk_packages.yaml file (describes SDK vendored package locations)

delete old macro code in _fe_analyzer_shared, move tests/benchmarks

adds a top level `pkg` directory to the Dart SDK, which is where vendored packages live

BUG: https://github.com/dart-lang/sdk/issues/54976
Change-Id: Ib3503a27fb5644fa8a39ab5a3e5b568df330cfd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359040
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2024-03-26 18:40:00 +00:00