Looks like a separate problem, but seems like Symbol properties aren't being validated correctly, ts-io treats them as if they didn't exist, though the TS types are correct. Might need to use Object.getOwnPropertySymbols in the code.
Your environment
Which versions of io-ts are affected by this issue? Did this work in previous versions of io-ts?
🐛 Bug report
Current Behavior
decode()
reports errors when trying to validate an intersection of a function with an object (i.e. a function with additional properties).Expected behavior
No errors.
Reproducible example
https://codesandbox.io/s/io-ts-reproduction-2lcmt5
Expand full code
```ts import * as t from "io-ts"; export const featureConfigProperty = Symbol("config"); const FeatureActionFnValidator = t.Function; export type FeatureActionFn = t.TypeOfSuggested solution(s)
If an intersection contains mixed object with function, the decoder should only test for function type, and then validate the presence of properties.
My bet is that this code here is at fault (specifically,
typeof u === 'object'
fails):https://github.com/gcanti/io-ts/blob/616583de0198632cad7820ed8701b15f654c7fd2/src/index.ts#L987-L1000 (also in https://github.com/gcanti/io-ts/blob/616583de0198632cad7820ed8701b15f654c7fd2/src/Guard.ts#L98C14-L100)
Additional context
Looks like a separate problem, but seems like Symbol properties aren't being validated correctly, ts-io treats them as if they didn't exist, though the TS types are correct. Might need to use
Object.getOwnPropertySymbols
in the code.Your environment
Which versions of io-ts are affected by this issue? Did this work in previous versions of io-ts?