asThisType method

dynamic asThisType(
  1. dynamic instance,
  2. bool question
)

将实例转换为该包装类型的实例,实质上是做类型判断

Implementation

dynamic asThisType(dynamic instance, bool question) {
  if (isThisType(instance, question)) return instance;
  throw ('Instance type: ${VmObject.readClass(instance).identifier} => Not matched class type: $identifier');
}