IsAmbiguous returns true if this type is in UnknownFamily or AnyFamily. Instances of ambiguous types can be NULL or be in one of several different type families. This is important for parameterized types to determine whether they are fully concrete or not.
()
| 1925 | // type families. This is important for parameterized types to determine whether |
| 1926 | // they are fully concrete or not. |
| 1927 | func (t *T) IsAmbiguous() bool { |
| 1928 | switch t.Family() { |
| 1929 | case UnknownFamily, AnyFamily: |
| 1930 | return true |
| 1931 | case CollatedStringFamily: |
| 1932 | return t.Locale() == "" |
| 1933 | case TupleFamily: |
| 1934 | if len(t.TupleContents()) == 0 { |
| 1935 | return true |
| 1936 | } |
| 1937 | for i := range t.TupleContents() { |
| 1938 | if t.TupleContents()[i].IsAmbiguous() { |
| 1939 | return true |
| 1940 | } |
| 1941 | } |
| 1942 | return false |
| 1943 | case ArrayFamily: |
| 1944 | return t.ArrayContents().IsAmbiguous() |
| 1945 | } |
| 1946 | return false |
| 1947 | } |
| 1948 | |
| 1949 | // IsStringType returns true iff the given type is String or a collated string |
| 1950 | // type. |
no test coverage detected