On Thursday, 16 March 2023 at 03:40:04 UTC, Elfstone wrote:
```D
struct Matrix(S, size_t M, size_t N)
{
}

alias Vec3(S) = Matrix!(S, 3, 1);

void main()
{
    import std.stdio;

writeln(is(Vec3!float == Matrix!(S, 3, 1), S)); // `alias` `S` is defined here writeln(is(Matrix!(float, 3, 1) == Matrix!(S, 3, 1), S)); // Error: declaration `S` is already defined
}
```

Even though the following code compiles.

```D
    writeln(is(Vec3!float == Matrix!(S, 3, 1), S));
    writeln(is(Vec3!float == Matrix!(S, 3, 1), S));
```

Oops, the above code compiles, because I added comments!!!

Now this really doesn't compile:

```D
struct Matrix(S, size_t M, size_t N)
{
}

alias Vec3(S) = Matrix!(S, 3, 1);

void main()
{
    import std.stdio;

    writeln(is(Vec3!float == Matrix!(S, 3, 1), S));
    writeln(is(Matrix!(float, 3, 1) == Matrix!(S, 3, 1), S));
}
```

Reply via email to