Dart analyzer reports 'dynamic' as type for proto generated elements?

26 views
Skip to first unread message

Dwight Naylor

unread,
Dec 23, 2020, 7:53:16 PM12/23/20
to Dart Analyzer Discussion
Hey Folks,

Not sure how much I can post, since this is an external group...

I'm trying to use the dart analyzer's elements to figure out the types for some parameters to a constructor.

Mostly this works wonderfully, but it fails for some proto generated code. Parameters in question both have the type 'dynamic'. Is this normal behavior for proto generated parameters? I think I've seen it work properly with others.

Please LMK if there's an internal channel I can post links to etc.

-Dwight

Brian Wilkerson

unread,
Dec 23, 2020, 8:01:41 PM12/23/20
to analyzer...@dartlang.org
> Please LMK if there's an internal channel I can post links to etc.

You're welcome to create an issue in the internal issue tracker, but I'll answer here in case the information if useful for anyone.

> Mostly this works wonderfully, but it fails for some proto generated code. Parameters in question both have the type 'dynamic'. Is this normal behavior for proto generated parameters?

The analyzer will return a type of `dynamic` under two conditions:
  • if the type is specified to be dynamic either explicitly (`void f(dynamic p) {}`) or implicitly (`void f(p) {}`), or
  • if the explicitly specified type can't be found.
The latter case can occur for several reasons, including the possibility that code that is expected to be generated hasn't been generated yet.

--
You received this message because you are subscribed to the Google Groups "Dart Analyzer Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzer-discu...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/analyzer-discuss/9839c2c9-66c7-4f2f-a5fd-5713945db47cn%40dartlang.org.
Reply all
Reply to author
Forward
0 new messages