H
Harold Howe
According to the C# 2.0 draft spec, the following should not compile:
class G1<U>
{
long F1(U u) {return 0;} // Invalid overload, G<int> would have two
int F1(int i){return 1;} // members with the same signature
}
However, it compiles without error or warning for me. This also compiles
clean:
class G1<U>
{
int F1(U u) {return 0;} // Invalid overload, G<int> would have two
int F1(int i){return 1;} // members with the same signature
}
Did the spec change on this? Is this now allowed? The version of the
spec that I downloaded was from May 2004.
FWIW, compiler version is
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
H^2
class G1<U>
{
long F1(U u) {return 0;} // Invalid overload, G<int> would have two
int F1(int i){return 1;} // members with the same signature
}
However, it compiles without error or warning for me. This also compiles
clean:
class G1<U>
{
int F1(U u) {return 0;} // Invalid overload, G<int> would have two
int F1(int i){return 1;} // members with the same signature
}
Did the spec change on this? Is this now allowed? The version of the
spec that I downloaded was from May 2004.
FWIW, compiler version is
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
H^2