Skip to content

Commit 4b8cb7e

Browse files
committed
Remove most of associated types
1 parent 9955269 commit 4b8cb7e

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

+4-6
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+2
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

-32
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_cannot_be_in_intersection1.phpt

-13
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_cannot_be_in_intersection2.phpt

-13
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_cannot_be_in_union1.phpt

-13
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_cannot_be_in_union2.phpt

-13
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_cannot_be_in_union3.phpt

-13
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_cannot_be_in_union4.phpt

-13
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_cannot_be_in_union5.phpt

-13
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_in_class.phpt

-13
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_in_trait.phpt

-13
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_with_constraint.phpt

-32
This file was deleted.

Zend/tests/type_declarations/associated/associated_type_with_constraint_failed.phpt

-17
This file was deleted.

Zend/tests/type_declarations/associated/extended_interface_associated_type_redeclared.phpt

-23
This file was deleted.

Zend/tests/type_declarations/associated/extended_interface_associated_types.phpt

-22
This file was deleted.

Zend/tests/type_declarations/associated/extended_interface_new_associated_types.phpt

-26
This file was deleted.

0 commit comments

Comments
 (0)