-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
float a=a; #153
Comments
The spec has interesting test cases related to scoping: int x = 1;
{
int x = 2, y = x; // y is initialized to 2
}
struct S{ int x; };
{
S S = S(0); // 'S' is only visible as a struct and constructor
S; // 'S' is now visible as a variable
}
int x = x; // Error if x has not been previously defined.
// If the previous definition of x was in this
// same scope, this causes a redeclaration error.
int f( /* nested scope begins here */ int k) {
int k = k + 3; // redeclaration error of the name k
}
int f(int k)
{
{
int k = k + 3; // 2nd k is parameter, initializing nested first k
int m = k; // use of new k, which is hiding the parameter
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ttg reported on Discord:
We could need to update our scope resolution to allow this.
It's unclear what the behavior in HLSL is (I wouldn't be surprised if it was treated as a circular reference).
The text was updated successfully, but these errors were encountered: