(exprType *Type, expression *ast.Node)
| 28819 | } |
| 28820 | |
| 28821 | func (c *Checker) getOptionalExpressionType(exprType *Type, expression *ast.Node) *Type { |
| 28822 | switch { |
| 28823 | case ast.IsExpressionOfOptionalChainRoot(expression): |
| 28824 | return c.GetNonNullableType(exprType) |
| 28825 | case ast.IsOptionalChain(expression): |
| 28826 | return c.removeOptionalTypeMarker(exprType) |
| 28827 | default: |
| 28828 | return exprType |
| 28829 | } |
| 28830 | } |
| 28831 | |
| 28832 | func (c *Checker) removeOptionalTypeMarker(t *Type) *Type { |
| 28833 | if c.strictNullChecks { |
no test coverage detected