macro_prototype icon indicating copy to clipboard operation
macro_prototype copied to clipboard

Enhanced Type manipulation

Open rrousselGit opened this issue 4 years ago • 1 comments

So far, a type only exposes limited informations

It would be useful to add extra utilities, such as:

  • converting a runtimeType into a type (similar to TypeChecker from the analyzer)
  • expose an utility to obtain the nearest common interface between two types (like num for double+int, but Object for String+int)

rrousselGit avatar Aug 10 '21 11:08 rrousselGit

  • converting a runtimeType into a type (similar to TypeChecker from the analyzer)

This one you can do from the builder instances in your macro - see the type{Reference|Declaration|Definition}Of apis. Or I think that is what you were asking for at least :).

  • expose an utility to obtain the nearest common interface between two types (like num for double+int, but Object for String+int)

Ya I think we also want a utility to check if some type is exactly another type. Possibly with or without taking into account the generic type.

jakemac53 avatar Aug 10 '21 14:08 jakemac53