Type Definition ink_metadata::DisplayName

source ·
pub type DisplayName<F> = Path<F>;
Expand description

Describes the syntactical name of a type at a given type position.

This is important when trying to work with type aliases. Normally a type alias is transparent and so scenarios such as

type Foo = i32;
fn bar(foo: Foo);

Will only communicate that foo is of type i32 which is correct, however, it will miss the potentially important information that it is being used through a type alias named Foo.

In ink! we currently experience this problem with environmental types such as the Balance type that is just a type alias to u128 in the default setup. Even though it would be useful for third party tools such as the Polkadot UI to know that we are handling with Balance types, we currently cannot communicate this without display names.