Never allow typedefs with the same names as classes

Right now, we allowed it as long as the typedef was for the
same class.  (Oversight.)  This involved a few error message changes
in existing tests.
Esse commit está contido em:
Jordan DeLong
2013-06-20 16:13:14 -07:00
commit de Sara Golemon
commit f828a7af6d
5 arquivos alterados com 13 adições e 3 exclusões
+2 -1
Ver Arquivo
@@ -684,7 +684,8 @@ void Unit::defTypedef(Id id) {
// There might also be a class with this name already.
if (Class* cls = nameList->getCachedClass()) {
checkExistingClass(cls);
raise_error("The name %s is already defined as a class",
thisType->m_name->data());
return;
}
+1 -1
Ver Arquivo
@@ -1 +1 @@
HipHop Fatal error: The type Existing is already defined to a different class (Existing) in %s on line 6
HipHop Fatal error: The name Existing is already defined as a class in %s on line 6
+1 -1
Ver Arquivo
@@ -1 +1 @@
HipHop Fatal error: The type Something is already defined to a different class (Something) in %s on line 4
HipHop Fatal error: The name Something is already defined as a class in %s on line 4
+8
Ver Arquivo
@@ -0,0 +1,8 @@
<?hh
class Foo {
}
type Foo = Foo;
function main() {}
+1
Ver Arquivo
@@ -0,0 +1 @@
HipHop Fatal error: The name Foo is already defined as a class in %s on line 8