dragon-lang / dc

D Compiler
Boost Software License 1.0
8 stars 0 forks source link

Idea: template reference info #68

Closed marler8997 closed 5 years ago

marler8997 commented 5 years ago

This isn't a fully flushed out idea but wanted to save it here for later. Currently a template is a "one-way" operation. You give it some parameters and it instantiates something for you. When you access its "intantiates", there's not way to know where they came from.

template Declare(T)
{
    T[] array;
    T single;
}

If you reference Declare!int.single, you'll be referencing an int but there's no way to know that it came from the Declare template.