Skip to content

Commit 1405cc5

Browse files
committed
Remove most of associated types
1 parent b9ddf00 commit 1405cc5

37 files changed

+40
-547
lines changed

Zend/tests/type_declarations/associated/big_example.phpt renamed to Zend/tests/type_declarations/abstract_generics/big_example.phpt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ Levi Morrison
77

88
namespace Sequence;
99

10-
interface Sequence
10+
// No null. This is probably going to be painful, but let's try it.
11+
interface Sequence<Item : object|array|string|float|int|bool>
1112
{
12-
// No null. This is probably going to be painful, but let's try it.
13-
type Item: object|array|string|float|int|bool;
14-
1513
function next(): ?Item;
1614

1715
/**
@@ -29,7 +27,7 @@ final class StringTablePair
2927
) {}
3028
}
3129

32-
final class StringTableSequence implements Sequence
30+
final class StringTableSequence implements Sequence<StringTablePair>
3331
{
3432
private array $strings;
3533

@@ -99,4 +97,4 @@ final class StringTable
9997

10098
?>
10199
--EXPECTF--
102-
Fatal error: Associated type cannot be part of a union type in %s on line %d
100+
Fatal error: Generic type cannot be part of a union type in %s on line %d

Zend/tests/type_declarations/abstract_generics/errors/abstract_generic_cannot_be_in_intersection1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ interface I<T> {
99

1010
?>
1111
--EXPECTF--
12-
Fatal error: Associated type cannot be part of an intersection type in %s on line %d
12+
Fatal error: Generic type cannot be part of an intersection type in %s on line %d

Zend/tests/type_declarations/abstract_generics/errors/abstract_generic_cannot_be_in_intersection2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ interface I<T> {
99

1010
?>
1111
--EXPECTF--
12-
Fatal error: Associated type cannot be part of an intersection type in %s on line %d
12+
Fatal error: Generic type cannot be part of an intersection type in %s on line %d

Zend/tests/type_declarations/abstract_generics/errors/abstract_generic_cannot_be_in_union1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ interface I<T> {
99

1010
?>
1111
--EXPECTF--
12-
Fatal error: Associated type cannot be part of a union type in %s on line %d
12+
Fatal error: Generic type cannot be part of a union type in %s on line %d

Zend/tests/type_declarations/abstract_generics/errors/abstract_generic_cannot_be_in_union2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ interface I<T> {
99

1010
?>
1111
--EXPECTF--
12-
Fatal error: Associated type cannot be part of a union type in %s on line %d
12+
Fatal error: Generic type cannot be part of a union type in %s on line %d

Zend/tests/type_declarations/abstract_generics/errors/abstract_generic_cannot_be_in_union3.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ interface I<T> {
99

1010
?>
1111
--EXPECTF--
12-
Fatal error: Associated type cannot be part of a union type in %s on line %d
12+
Fatal error: Generic type cannot be part of a union type in %s on line %d

Zend/tests/type_declarations/abstract_generics/errors/abstract_generic_cannot_be_in_union4.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ interface I<T> {
99

1010
?>
1111
--EXPECTF--
12-
Fatal error: Associated type cannot be part of a union type in %s on line %d
12+
Fatal error: Generic type cannot be part of a union type in %s on line %d

Zend/tests/type_declarations/abstract_generics/errors/abstract_generic_cannot_be_in_union5.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ interface I<T> {
99

1010
?>
1111
--EXPECTF--
12-
Fatal error: Associated type cannot be part of a union type (implicitly nullable due to default null value) in %s on line %d
12+
Fatal error: Generic type cannot be part of a union type (implicitly nullable due to default null value) in %s on line %d

Zend/tests/type_declarations/abstract_generics/extended_interface_new_abstract_generic_type2.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
--TEST--
22
Abstract generic type behaviour in extended interface
3+
--XFAIL--
4+
Generic type is not properly bound (Declaration of C::foo(string $param): string must be compatible with I::foo(T $param): T)
35
--FILE--
46
<?php
57

Zend/tests/type_declarations/associated/associated_001.phpt

Lines changed: 0 additions & 32 deletions
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_cannot_be_in_intersection1.phpt

Lines changed: 0 additions & 13 deletions
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_cannot_be_in_intersection2.phpt

Lines changed: 0 additions & 13 deletions
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_cannot_be_in_union1.phpt

Lines changed: 0 additions & 13 deletions
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_cannot_be_in_union2.phpt

Lines changed: 0 additions & 13 deletions
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_cannot_be_in_union3.phpt

Lines changed: 0 additions & 13 deletions
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_cannot_be_in_union4.phpt

Lines changed: 0 additions & 13 deletions
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_cannot_be_in_union5.phpt

Lines changed: 0 additions & 13 deletions
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_in_class.phpt

Lines changed: 0 additions & 13 deletions
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_in_trait.phpt

Lines changed: 0 additions & 13 deletions
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_with_constraint.phpt

Lines changed: 0 additions & 32 deletions
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_with_constraint_failed.phpt

Lines changed: 0 additions & 17 deletions
This file was deleted.

Zend/tests/type_declarations/associated/extended_interface_associated_type_redeclared.phpt

Lines changed: 0 additions & 23 deletions
This file was deleted.

Zend/tests/type_declarations/associated/extended_interface_associated_types.phpt

Lines changed: 0 additions & 22 deletions
This file was deleted.

Zend/tests/type_declarations/associated/extended_interface_new_associated_types.phpt

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)