Skip to content

Scijava types/recursive stack overflow#120

Merged
hinerm merged 7 commits into
mainfrom
scijava-types/recursive-stack-overflow
Jan 26, 2024
Merged

Scijava types/recursive stack overflow#120
hinerm merged 7 commits into
mainfrom
scijava-types/recursive-stack-overflow

Conversation

@hinerm

@hinerm hinerm commented Jan 25, 2024

Copy link
Copy Markdown
Member

Detect and resolve mapping recursively parameterized types in GenericAssignability.inferTypeVariables

Closes scijava/scijava#176

@hinerm hinerm force-pushed the scijava-types/recursive-stack-overflow branch from 94ab0c1 to d45c316 Compare January 25, 2024 19:57
Just a convenience method for identifying recursive parameterization.
Recursively parameterized types can cause stack overflows when
recursively descending type hierarchies if not handled carefully.

In this case we continue the recursive descent using the raw type,
removing the risk of infinite recursion.

Closes scijava/scijava#176
Helper method to determine if a bound of another type is in fact
recursive, with its own type parameter equal to the bounded type.
Previously we were recursively checking bounds of type variables even if
those bounds were themselves recursive. This would create duplicate
mappings that worked incidentally because the values were the same
(since recursive) but this behavior broke in the change to recurse to
raw types instead (avoiding infinite recursion errors)
@hinerm hinerm force-pushed the scijava-types/recursive-stack-overflow branch from d45c316 to 0040f80 Compare January 26, 2024 17:11
@hinerm hinerm merged commit 18645d2 into main Jan 26, 2024
@hinerm hinerm deleted the scijava-types/recursive-stack-overflow branch January 26, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix StackOverflow errors from inferTypeVariables

1 participant