You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two changes in one here:
* I saw in manual testing that a class annotated with
`@Deprecated.extend()` was shown in dartdoc's HTML to just be annotated
with `@Deprecated`. 🤕 ouch. Dunno how that has been the case for so many
years; I guess named constructors are not used too much in annotations 🤷
. So this PR makes dartdoc use the _constructor_ involved
(`Deprecated.extend`) instead of the _type_ which is constructed
(`Deprecated`).
* _However_, that change makes all regular `@Deprecated("reason")`
annotations be printed as `@Deprecated.new("reason")`. That `.new` looks
_very non-idiomatic_. Gross. So I coupled another change here where we
override `displayName` on `Constructor` to _not_ include `.new` if we're
looking at an unnamed constructor.
This should be good to go. We might deprecate extending `RegExp` and
`RegExpMatch` in Dart 3.10; it'd be cool if we displayed the deprecated
annotations correctly for this release. Note that as per
669b15f,
we won't show the element as ~~struck through~~, so the release is safe.
But this PR would be a cherry on top.
Fixes#4107
0 commit comments