AsDTuple attempts to retrieve a *DTuple from an Expr, returning a *DTuple and a flag signifying whether the assertion was successful. The function should be used instead of direct type assertions wherever a *DTuple wrapped by a *DOidWrapper is possible.
(e Expr)
| 2910 | // be used instead of direct type assertions wherever a *DTuple wrapped by a |
| 2911 | // *DOidWrapper is possible. |
| 2912 | func AsDTuple(e Expr) (*DTuple, bool) { |
| 2913 | switch t := e.(type) { |
| 2914 | case *DTuple: |
| 2915 | return t, true |
| 2916 | case *DOidWrapper: |
| 2917 | return AsDTuple(t.Wrapped) |
| 2918 | } |
| 2919 | return nil, false |
| 2920 | } |
| 2921 | |
| 2922 | // maybePopulateType populates the tuple's type if it hasn't yet been |
| 2923 | // populated. |
no outgoing calls
no test coverage detected
searching dependent graphs…