(n *ast.Node, flagsToCheck ast.ModifierFlags)
| 3685 | } |
| 3686 | |
| 3687 | func (c *Checker) getEffectiveDeclarationFlags(n *ast.Node, flagsToCheck ast.ModifierFlags) ast.ModifierFlags { |
| 3688 | flags := c.getCombinedModifierFlagsCached(n) |
| 3689 | // children of classes (even ambient classes) should not be marked as ambient or export |
| 3690 | // because those flags have no useful semantics there. |
| 3691 | if !ast.IsInterfaceDeclaration(n.Parent) && !ast.IsClassDeclaration(n.Parent) && !ast.IsClassExpression(n.Parent) && n.Flags&ast.NodeFlagsAmbient != 0 { |
| 3692 | container := getEnclosingContainer(n) |
| 3693 | if container != nil && container.Flags&ast.NodeFlagsExportContext != 0 && flags&ast.ModifierFlagsAmbient == 0 && !(ast.IsModuleBlock(n.Parent) && ast.IsGlobalScopeAugmentation(n.Parent.Parent)) { |
| 3694 | // It is nested in an ambient export context, which means it is automatically exported |
| 3695 | flags |= ast.ModifierFlagsExport |
| 3696 | } |
| 3697 | flags |= ast.ModifierFlagsAmbient |
| 3698 | } |
| 3699 | return flags & flagsToCheck |
| 3700 | } |
| 3701 | |
| 3702 | func (c *Checker) isImplementationCompatibleWithOverload(implementation *Signature, overload *Signature) bool { |
| 3703 | erasedSource := c.getErasedSignature(implementation) |
no test coverage detected