IsAdditiveType returns true if the given type supports addition and subtraction.
(t *T)
| 2002 | // IsAdditiveType returns true if the given type supports addition and |
| 2003 | // subtraction. |
| 2004 | func IsAdditiveType(t *T) bool { |
| 2005 | switch t.Family() { |
| 2006 | case IntFamily: |
| 2007 | return true |
| 2008 | case FloatFamily: |
| 2009 | return true |
| 2010 | case DecimalFamily: |
| 2011 | return true |
| 2012 | default: |
| 2013 | return IsDateTimeType(t) |
| 2014 | } |
| 2015 | } |
| 2016 | |
| 2017 | // IsWildcardTupleType returns true if this is the wildcard AnyTuple type. The |
| 2018 | // wildcard type matches a tuple type having any number of fields (including 0). |
no test coverage detected
searching dependent graphs…