-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: report intersection with literal types (#20)
- Loading branch information
1 parent
8d926e0
commit de08a1c
Showing
4 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
function foo(null&Bar $bar): mixed {} | ||
|
||
function foo(Bar&null $bar): mixed {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error[P0047]: literal type `null` cannot be used in an intersection | ||
--> 0105/code.ara:2:14 | ||
| | ||
2 | function foo(null&Bar $bar): mixed {} | ||
| ^^^^- | ||
| | | ||
| literal type `null` cannot be used in an intersection | ||
| | ||
= note: a literal type is either a literal integer, a literal float, a literal string, `false`, `true`, or `null`. | ||
= help: try using a different type for the intersection. | ||
|
||
error[P0047]: literal type `null` cannot be used in an intersection | ||
--> 0105/code.ara:4:18 | ||
| | ||
4 | function foo(Bar&null $bar): mixed {} | ||
| -^^^^ literal type `null` cannot be used in an intersection | ||
| | ||
= note: a literal type is either a literal integer, a literal float, a literal string, `false`, `true`, or `null`. | ||
= help: try using a different type for the intersection. | ||
|