dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.12k stars 1.57k forks source link

Macros: expose `isConst` on `ConstructorDeclaration` #55768

Open felangel opened 4 months ago

felangel commented 4 months ago

Currently it's not possible to determine whether a constructor is a const constructor or not when building a macro. I would love to see isConst exposed via ConstructorDeclaration alongside isFactory

https://github.com/dart-lang/sdk/blob/6bc417dd17f5edb228e60b9aebb70650bf7d5f50/pkg/_macros/lib/src/api/introspection.dart#L286.

davidmorgan commented 4 months ago

Thanks! This is useful to come back to but not super high priority right now so I'll move it to the backlog.