Repository: TypeScript
Issue: Can't make type predicate functions in mapped types
Labels: Suggestion,Awaiting More Feedback

# Bug Report

### 🔎 Search Terms
type predicate
mapped types
union types
mapped type predicates


### 🕗 Version & Regression Information
4.9.3 & 4.9.4

- This is the behavior in every version I tried, and I reviewed the FAQ for entries about mapped type predicates


### ⏯ Playground Link
https://www.typescriptlang.org/play?#code/PTAuAsFMAIHMHsCGAbaBLAztU86QHaQBOioMoAngA4xVGQAmaAxqTAGYCu+zoa8+LO3hFoifNHgAjAFaRe0bv3wAaaEwzMiaALZp8bBtCkUx0DKG35Y0ZGjIlU7NJGQMAXNACSEiJmisGORQ0M6uRgBElDQRAFAgEDBSnDb+pNghBEbw7Lb6MAAsAIxqEQCC2NS09EysZOhYAsimKMjwAO6M6BL0oJxEvlXQVPAY9sqhIqHcvMpY4kY6kBDwDBgRAHTQAKIAbgQZ8Cng6KAN3Rkwvf0SI2N8ApOiiNM8D-ixyMvq8MyeAKr4ZQABRqLDYGAAPAARABC0N+AD5oABeaD4TjIVCIeb4CggDFYp7YSAWfQ2Kj9O6ktTtNBEqQwXRUL5LfBkIx0iDQABSAGVhkR4AAPUzSOS8WJodgACgYvw2mAAKlUvDpYMDRqAZQBKHUAb1i0GNAQEGHgXw2bVgcoVukQsEg-yIyB1AG5YgBfaCuILoWXy5iKjAqmiarGaiy6g1Gk3MM0WyBW+A2wMbPigL7ur2xWLRGBKyDC0AAWVJGAdMDRhpN0AA+mgPOZLOTY8b854AORkYsljCwTtt0JCnT-IJETwWKywIc4MfESct6yz3SQPmgRA6KieDE6RlEIdLDAVx2L6c5-PeHSVyNnatDhtNqet2sd6Cd3QarWD2v2x3O5AzxfE1MAANUwNApC+TwpHgRNxCHLRIEMMpQB3Tg92IC8hnDZBb1RaAaxNR8gOXV8qi7EYI2-FdM0gUiZ1reAqHeDAGIAbQAXSHXZ4DINj0Qw-cuOwmhoDhBFmAIwte3LStoAAHyvG8tUU6BcNvXMtMvQEQTBOpSUhJVkTRABheAdB0AQAGl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owiysKImWUWEYRAzjdWUKgxqiBmpKjUBUeu3BG7tD2qDNEXFQH4MKTo8p2AiCRyHETHqtV6rvOatsYUzBkCcAYLLL56lmLgqqtADmuL4UVTnhsMoBshyeBKaS8lyyVnwrqtsn6uzlBDNATKQ59djnKM2ucs2lz4BzJuaYkZMohy8u6NPbwsQLlXNhdK2swqPSOIcbEIAA

### 💻 Code
This is an abbreviated example of the bug. Please see playground for actual example. 
`type Test<T,Other> = {
        [P in keyof T]: () => (T is Other)
    }`



### 🙁 Actual behavior

Compile time error: A type predicate is only allowed in return type position for functions and methods.

### 🙂 Expected behavior

The type predicate is in the return type position for a function. These functions should be useable type discriminators.

For wider context, I'm trying to generate type predicate functions for a union object. The first 8 lines of the playground linked above gives an example of this.