Aliasing in Solidity

Hey there,

Maybe this is not the right forum to ask this question since it’s more about the solidity programming language, but I figured people here might have encountered the same problem, which is, is there a way of aliasing a self-defined variable type?

Inspired by EnumerableSet, I created a library EnumerableRangeSet for a data structure in my project. In this library, two structs Range, and RangeSet are created. The problem is EnumerableRangeSet.Range as a data type has to be passed to functions invoked by a EnumerableRangeSet.RangeSet object. This is where I got motivated to ask this question about aliasing.

Any suggestion? Thanks.

There is no type aliasing yet in Solidity. The issue https://github.com/ethereum/solidity/issues/1100 seems to be in “design backlog”.

1 Like