Fixing constraint bug, pretty printing constraints
This commit is contained in:
parent
784e095345
commit
479abf7996
2 changed files with 6 additions and 4 deletions
|
|
@ -344,7 +344,9 @@ export function prettyPrint(ast: AST, indent = 0): string {
|
|||
|
||||
case 'definition':
|
||||
const ann = ast.annotation
|
||||
? ` : ${prettyPrintType(ast.annotation.type)}`
|
||||
? ` : ${ast.annotation.constraints.length > 0
|
||||
? ast.annotation.constraints.map(c => `${c.className} ${c.typeVar}`).join(', ') + ' :: '
|
||||
: ''}${prettyPrintType(ast.annotation.type)}`
|
||||
: '';
|
||||
if (!ast.body) return `${ast.name}${ann};`;
|
||||
return `${ast.name}${ann} = ${prettyPrint(ast.body, indent)};`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue