You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{pipe}from'fp-ts'import{get}from'spectacles-ts'interfaceRecursive{key: Recursive;}declareconstr: Recursiveconstkey=pipe(r,get("key"))// type instantiation is excessively deep and possibly infinite// (it is infinite!)
Expected behavior
constkey=pipe(r,get("key"))// key: Recursive
Reproducible example
Types from the DOM are great test cases here
Element, Document etc.
Suggested solution(s)
Check at each Path that it does not extend one of its parent interfaces
Would allow exactly one traversal of a recursive interface
Should be simple, relatively lightweight (in that it wouldn't involve a distributive conditional) and (I don't think) would trigger false positives
Additional context
This shouldn't affect too too many use cases - 'get' on a DOM node, 'set' for a 'tree' value - anything else?
I don't think many people are using immutability helper or immer.js for this kind of thing
Your environment
Software
Version(s)
spectacles-ts
1.0.7
fp-ts
2.11
TypeScript
4.6
The text was updated successfully, but these errors were encountered:
🐛 Bug report
Recursive Interfaces Cause Infinite Paths
Current Behavior
Expected behavior
Reproducible example
Types from the DOM are great test cases here
Element
,Document
etc.Suggested solution(s)
Check at each Path that it does not extend one of its parent interfaces
Would allow exactly one traversal of a recursive interface
Should be simple, relatively lightweight (in that it wouldn't involve a distributive conditional) and (I don't think) would trigger false positives
Additional context
This shouldn't affect too too many use cases - 'get' on a DOM node, 'set' for a 'tree' value - anything else?
I don't think many people are using immutability helper or immer.js for this kind of thing
Your environment
The text was updated successfully, but these errors were encountered: