typocomath/src/generic/infer.ts

15 lines
498 B
TypeScript
Raw Normal View History

export function infer<T>(arg: T) : T {
console.error('infer should be replaced with runtime type information by a magic TypeScript plugin')
return arg
}
2023-09-01 15:52:44 +00:00
export function typed<T>(name: string, types: string, arg: T) : T {
// TODO: implement typed-function for real
if (types === '__infer__') {
console.error('__infer__ should be replaced with runtime type information by the TypeScript plugin')
}
console.log(`Creating typed-function "${name}" with types ${types}`)
2023-09-01 15:52:44 +00:00
return arg
}