TypeParameterToStringEx renders a type parameter declaration (e.g. "T extends Foo") with optional verbosity support.
(t *Type, enclosingDeclaration *ast.Node, vc *VerbosityContext)
| 456 | |
| 457 | // TypeParameterToStringEx renders a type parameter declaration (e.g. "T extends Foo") with optional verbosity support. |
| 458 | func (c *Checker) TypeParameterToStringEx(t *Type, enclosingDeclaration *ast.Node, vc *VerbosityContext) string { |
| 459 | nodeBuilder, release := c.getNodeBuilder() |
| 460 | defer release() |
| 461 | oldVerbosity := nodeBuilder.verbosity |
| 462 | nodeBuilder.verbosity = vc |
| 463 | defer func() { |
| 464 | nodeBuilder.verbosity = oldVerbosity |
| 465 | }() |
| 466 | typeParamNode := nodeBuilder.TypeParameterToDeclaration(t, enclosingDeclaration, nodebuilder.FlagsIgnoreErrors, nodebuilder.InternalFlagsNone, nil) |
| 467 | if typeParamNode == nil { |
| 468 | return c.TypeToString(t) |
| 469 | } |
| 470 | p := createPrinterWithRemoveComments(nodeBuilder.EmitContext()) |
| 471 | var sourceFile *ast.SourceFile |
| 472 | if enclosingDeclaration != nil { |
| 473 | sourceFile = ast.GetSourceFileOfNode(enclosingDeclaration) |
| 474 | } |
| 475 | return p.Emit(typeParamNode, sourceFile) |
| 476 | } |
| 477 | |
| 478 | func (c *Checker) TypeToTypeNodeEx(t *Type, enclosingDeclaration *ast.Node, flags nodebuilder.Flags, internalFlags nodebuilder.InternalFlags, idToSymbol map[*ast.IdentifierNode]*ast.Symbol) *ast.TypeNode { |
| 479 | nodeBuilder := c.getNodeBuilderEx(idToSymbol) |
no test coverage detected