>Date: Mon, 21 Jun 2004 13:52:02 -0700
>From: Dave Rich <David.Rich@synopsys.com>
>Yes, I agree. import p::color; should behave as if declared locally
>(except the "master" equivalent type resides in the package)
It is not clear to me where this stops. One name is explicitly imported,
and other associated names are getting implicitly imported because they
are "part" of the thing being imported. With an enum, it seems clear
that this is desirable. But what about related situations?
Yes, if you physically copied the declaration of color into the local
scope, you would get the enum constants also, because they are part of
the syntax of the declaration. But is it this accident of syntax that
determines whether the enum constant names are imported, or are they
imported any time an enum type is imported? For example, if color is
just a typedef for hue (which actually defines a set of enum constants),
does importing color also import hue, and all its constant names?
What if a struct type has a field that is of a user-defined type? If
the struct type is imported, are all the types used in defining it
also imported? For example, if a struct type has a field that is
an enum, does importing the struct type implicitly import all of the
enum constant names?
What about a variable of a user-defined type? Does importing that variable
implicitly import the type?
What about a function with a user-defined type? Does importing that
implicitly import the type? What about the types of the function arguments,
or the types of its local variables, or the types declared inside the
function itself?
What are the rules?
Steven Sharp
sharp@cadence.com
Received on Mon Jun 21 14:38:51 2004
This archive was generated by hypermail 2.1.8 : Mon Jun 21 2004 - 14:39:06 PDT