# isAssignable static method

bool isAssignable(

1. Class left,
2. Class right

)

Check if the right-hand side type may be assigned to the left-hand side type.

Considers primitive wrapper classes as assignable to the corresponding primitive types.

- Parameters left: the target type (left-hand side (LHS) type) right: the source type (right-hand side (RHS) type)

- Returns `true` if the right-hand side type may be assigned to the left-hand side type; otherwise, `false`.

## Implementation

    static bool isAssignable(Class left, Class right) {
      if (left.isAssignableFrom(right)) {
    			return true;
    		}

      if (left.isPrimitive()) {
    			Class? resolvedPrimitive = _primitiveWrapperTypeMap.get(right);
    			return (left == resolvedPrimitive);
    		}
    		else if (right.isPrimitive()) {
    			Class? resolvedWrapper = _primitiveTypeToWrapperMap.get(right);
    			return (resolvedWrapper != null && left.isAssignableFrom(resolvedWrapper));
    		}
    		return false;
    }