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
I would have expected that the following doc comment generates a dartdoc error because "SnackBarAction." (note the dot at the end) is not a valid reference. Instead, it silently interprets [SnackBarAction.] as [SnackBarAction] and links to the class. So, we totally missed, that the reference was incomplete.
/// Overrides default value for [SnackBarAction.].
The text was updated successfully, but these errors were encountered:
The rendered HTML also shows the link with a strange extra dot:
srawlins
added
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
P2
A bug or feature request we're likely to work on
labels
Feb 16, 2024
This one is tricky though. Not everything between [] is a reference. We should only interpret code in a pattern like \[[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)?)?\] as a reference.
So the correct behavior is probably to just not consider [Foo.] as a reference (which is what the analyzer does). It wouldn't be reported either. Users are generally just allowed to write square brackets with non-code references between.
Users are generally just allowed to write square brackets with non-code references between.
Really? I thought if I write [Foo] and Foo is not a class or anything else referencable dartdoc throws an error. I have definitely seen dartdoc complain about this.
Yes, dartdoc does that. But if you write text that doesn't fit the pattern above, like /// check out list[0] or /// hello [weird parenthetical remark]., then both the analyzer and dartdoc think, "well i don't think they're trying to write any kind of reference to an element..." and does not complain.
See https://github.com/flutter/flutter/pull/143588/files.
I would have expected that the following doc comment generates a dartdoc error because "SnackBarAction." (note the dot at the end) is not a valid reference. Instead, it silently interprets
[SnackBarAction.]
as[SnackBarAction]
and links to the class. So, we totally missed, that the reference was incomplete./// Overrides default value for [SnackBarAction.].
The text was updated successfully, but these errors were encountered: