Skip to content

Commit

Permalink
Fix higher order types crashes on immutable php types
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Nybroe committed Oct 12, 2021
1 parent ce5beff commit 8871013
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
# collections-intellij Changelog

## [Unreleased]
### Fixed
- Fixed immutable php type issues

## [0.3.4]
### Fixed
- Fixed recursive collection on variables with no types
### Fixed
- Fixed recursive collection on variables with no types
- Fix higher order type provider when no types are possible

## [0.3.3]
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

pluginGroup = dev.nybroe.collector
pluginName = Collector
pluginVersion = 0.3.4
pluginVersion = 0.3.5

# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ class HigherOrderTypeProvider : PhpTypeProvider4 {
// Resolve type of the signature.
val type = PhpIndex.getInstance(project)
.getBySignature(signature.split('|')[0])
.map { it.type }
.reduceOrNull { acc, phpType -> acc.add(phpType) }
.map { PhpType.builder().add(it.type) }
.reduceOrNull { acc, phpType -> acc.merge(phpType) }
?.build()
?.global(project)

if (type === null) return null
Expand Down

0 comments on commit 8871013

Please sign in to comment.