1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00
Commit Graph

95 Commits

Author SHA1 Message Date
Matt Brown
5da816f160
Ensure getId() output can always be parsed as a type
Ref #5105
2021-01-29 11:47:36 +01:00
ec901d2e44
Check iterator types on yield from (#5042)
* Check iterator types on yield from

* Switch to NodeAbstract

* Make Foo iterable
2021-01-29 11:47:33 +01:00
Matt Brown
d81d57a30e
Fix #5029 - remember staticness of types when combining 2021-01-29 11:47:32 +01:00
orklah
31be6212b7
add stubs for standard iterators (#4725)
* add stubs for standard iterators

* Apply suggestions from code review cc @weirdan

Co-authored-by: Bruce Weirdan <weirdan@gmail.com>

* complete stub + delete code made redundant by stubs + fix some syntax in stubs

* fix parse error

Co-authored-by: Bruce Weirdan <weirdan@gmail.com>
2021-01-29 11:47:28 +01:00
Matthew Brown
ba823602ea
Fix #4901 - simplify mapping of template types within class 2021-01-29 11:47:23 +01:00
2e3s
df8d2e2296
Overwrite memoized return type after sum-type candidate is calculated (#4805)
* Overwrite memoized return type after sum-type candidate is calculated

* Fix mismatched types

* Fix code style
2021-01-29 11:47:18 +01:00
Matt Brown
8bfb0412e7
Fix #4782 - don’t replace closure types with upper bounds when replacing class param types 2021-01-29 11:47:16 +01:00
Matt Brown
9789b53617
Fix #4731 - expand out class-bound generic types when evaluating instance method 2021-01-29 11:47:06 +01:00
Matt Brown
8c33bedfca
Fix #4733 - don’t replace template types when they’re defined on the same class 2021-01-29 11:47:06 +01:00
Matt Brown
fb474c2e07
Expand out constants in param types earlier 2021-01-29 11:47:06 +01:00
Matt Brown
ad5ec9501d
Ensure class template types are mapped to static methods where necessary
Ref #4733
2021-01-29 11:47:06 +01:00
Matt Brown
ecbb5c77b2
Fix test failures 2021-01-29 11:46:26 +01:00
Matt Brown
5219932408
Fix #4545 - allow intersections in more places 2021-01-29 11:46:10 +01:00
Matt Brown
e90b595b92
Break apart ReflectorVisitor 2021-01-29 11:44:29 +01:00
Matt Brown
05f2d01cb6
Fix #4326 - Prevent later remapping of properties 2021-01-29 11:39:55 +01:00
Matt Brown
1915f34959
Fix #4326 - prevent more mapping than necessary 2021-01-29 11:39:55 +01:00
Pol Dellaiera
2b437ad672
Add more standard iterators (#4320)
* Add CachingIterator, LimitIterator, InfiniteIterator, CallbackFilterIterator, NoRewindIterator.

Signed-off-by: Pol Dellaiera <pol.dellaiera@protonmail.com>

* Add related Iterator tests.

Signed-off-by: Pol Dellaiera <pol.dellaiera@protonmail.com>
2021-01-29 11:39:54 +01:00
orklah
db45ff1ba4
More return types (#4173)
* add native return types

* redundant phpdoc
2021-01-29 11:38:57 +01:00
Brown
c96ba8d1f5
Add some backwards-incompatible changes for 4.x 2021-01-29 11:38:48 +01:00
m0003r
e81593f359
Localize types on magic properties (#3971)
* Fix #3949 - localize types on magic properties

* fix failing tests

* fix code style

Co-authored-by: m03r <m03r@m03r.net>
2020-08-10 12:45:21 -04:00
Matthew Brown
6085e42fc1 Detect mismatching param names effectively 2020-08-10 09:58:43 -04:00
Brown
afce2dc66f Tighten up rules around instantiation a bit more 2020-08-06 10:18:55 -04:00
Brown
c0b0036109 Fix #3934 - prevent unsafe use of new static 2020-08-05 19:39:27 -04:00
Brown
1c8f9e94b1 Fix #3907 - allow template as types to be refined via instanceof 2020-07-29 17:46:45 -04:00
Brown
76bd5b6278 Refactor type comparison 2020-07-21 19:40:35 -04:00
Brown
137647a1a0 Fix #3603 - better typed value comparisons for loose equality 2020-06-18 09:31:38 -04:00
Brown
043c4b2a98 Skip test that requires ext-ds 2020-05-25 18:47:59 -04:00
Brown
7e7456c863 Make taint checks more thorough 2020-05-25 17:10:53 -04:00
Brown
109920be88 Expand template param before comparison 2020-05-25 11:51:10 -04:00
Matthew Brown
952216ff21 Fix test 2020-05-20 23:24:50 -04:00
Matthew Brown
2d02064962 Fix #3407 - allow multiple matching generic classes in union 2020-05-20 09:11:17 -04:00
Brown
f335560b69 Allow setting property on templated type 2020-05-19 17:31:05 -04:00
Brown
bf5e178d16 Fix #3289 - treat property on non-generic type like actual value 2020-05-02 23:37:59 -04:00
Brown
3e07684855 Fix iterable coercion for Traversable-extending types
Fixes #3159
2020-04-19 09:15:20 -04:00
Brown
8d29b27204 Allow assigning null to template with null potential 2020-04-18 15:34:14 -04:00
Brown
b0455adced Fix #3177 - prevent crash by using inherited templates 2020-04-18 11:48:22 -04:00
Matthew Brown
d1270a61c7 Suppress MixedAssignment again 2020-04-05 01:04:52 -04:00
Brown
0db49e38f0 Covariant can accept anything 2020-04-04 12:05:01 -04:00
Brown
1b01d7b356 Fix tests 2020-04-04 11:51:24 -04:00
Brown
c0e573ab6a Try harder to understand templated array_map callable array
Fixes #3039
2020-04-03 16:53:56 -04:00
Matthew Brown
de6aee32d1 Fix #3035 - improve templating for property assignments 2020-03-28 17:18:21 -04:00
iggyvolz
94b246b987
Initial commit (#3013) 2020-03-24 18:32:57 -04:00
Brown
f6759c3d16 Check return statement types for inherited docblocks 2020-03-24 17:59:48 -04:00
Matthew Brown
50eb12e562 Fix implementation kink 2020-03-15 16:14:09 -04:00
Brown
a0da7356e9 Fix #2935 - make handling of templated properties much less hacky 2020-03-09 09:59:02 -04:00
Brown
09137b0a32 Fix #2918 - fix contradiction issue with templated equality 2020-03-05 16:21:41 -05:00
Matthew Brown
f44c3488eb Keep track of which arg a given template was assigned from
Fixes #2900 - We only care about the depth of a templated match when templating from a particular argument. The next argument should essentially start afresh
2020-03-01 12:27:18 -05:00
Brown
35c1670602 Fix #2875 - treat intersections more similarly than before 2020-02-27 18:42:15 -05:00
Matthew Brown
fb5a0c39cb Fix #2819 - improve negated assertions on templates 2020-02-14 11:18:47 -05:00
Matthew Brown
b439a573ce Empty is also the bottom type 2020-02-08 11:40:22 -05:00