(node *ast.Node)
| 989 | } |
| 990 | |
| 991 | func (b *Binder) bindFunctionOrConstructorType(node *ast.Node) { |
| 992 | // For a given function symbol "<...>(...) => T" we want to generate a symbol identical |
| 993 | // to the one we would get for: { <...>(...): T } |
| 994 | // |
| 995 | // We do that by making an anonymous type literal symbol, and then setting the function |
| 996 | // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable |
| 997 | // from an actual type literal symbol you would have gotten had you used the long form. |
| 998 | symbol := b.newSymbol(ast.SymbolFlagsSignature, b.getDeclarationName(node)) |
| 999 | b.addDeclarationToSymbol(symbol, node, ast.SymbolFlagsSignature) |
| 1000 | typeLiteralSymbol := b.newSymbol(ast.SymbolFlagsTypeLiteral, ast.InternalSymbolNameType) |
| 1001 | b.addDeclarationToSymbol(typeLiteralSymbol, node, ast.SymbolFlagsTypeLiteral) |
| 1002 | typeLiteralSymbol.Members = make(ast.SymbolTable) |
| 1003 | typeLiteralSymbol.Members[symbol.Name] = symbol |
| 1004 | } |
| 1005 | |
| 1006 | func (b *Binder) addLateBoundAssignmentDeclarationToSymbol(node *ast.Node, symbol *ast.Symbol) { |
| 1007 | exports := ast.GetExports(symbol) |
no test coverage detected