The extension I am writing is InfiniteOpt.jl. Which is designed as a general modeling interface for infinite dimensional optimization problems (e.g., dynamic, stochastic, etc.). It employs InfiniteModel <: JuMP.AbstractModel that uses multiple variable types such as infinite variables, point variables, and hold variables which are used to form constraints. These each have their own variable references with a certain hierarchy to keep track if constraints are infinite or not. This hierarchical information is then used to efficiently dispatch methods to ultimately discretize and solve the model. The documentation describes everything in detail (especially on the expressions page).
Previously, I tried implementing a single variable reference type that stored the variable type as an attribute (thus negating this thread), but this led to severe performance degradation since the hierarchical type information was lost and each expression had to be searched to determine what variable types it contained.