Type is not a Type. But is a Function which returns Type when type is recursive
See original GitHub issueI’ve tried this sample with recursive type. And i found that type is a function, not a Type.
I have last version of tst-reflect and ts-node.
import { getType } from 'tst-reflect';
type Settings = {
users: User[];
};
type User = {
friends: User[];
};
console.log(
getType<Settings>()
.getProperties()[0]
.type.getTypeArguments()[0]
.getProperties()[0]
.type.isObjectLike()) // isObjectLike() is not a function
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Error when using recursive type in a function - Stack Overflow
RecursiveGetIndex <NestedRecord> is the real problem here and this is because of how any works for a conditional type.
Read more >2.4. Functions — OCaml Programming - GitHub Pages
OCaml functions are not methods: they are not components of objects, and ... Since the if expression has type int , the function's...
Read more >Documentation - TypeScript 3.7
The other type of assertion signature doesn't check for a condition, but instead tells TypeScript that a specific variable or property has a...
Read more >4 Types in Typed Racket - Racket Documentation
The first type describes a function that has no mandatory arguments, one optional argument with type Number, and returns a Number.
Read more >Reading 16, Part 1: Recursive Data Types
Just as a recursive function is defined in terms of itself, a recursive datatype is defined in terms of itself. We'll see the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@Hookyns Thank you very much! Now is working ok
Okay, I’ll check it again; this must be something with the Array, cuz I wrote test with:
it didn’t work too and now it works. I should try your example first, sorry.