contains method

  1. @override
bool contains(
  1. String varName
)
override

Create a HTInstance of this HTClass, will not call constructors

Implementation

// HTInstance createInstance({List<HTType> typeArgs = const []}) {
//   return HTInstance(this, interpreter, typeArgs: typeArgs);
// }

// HTInstance createInstanceFromJson(Map<dynamic, dynamic> jsonObject,
//     {List<HTType> typeArgs = const []}) {
//   return HTInstance(this, interpreter,
//       typeArgs: typeArgs,
//       jsonObject:
//           jsonObject.map((key, value) => MapEntry(key.toString(), value)));
// }

@override
bool contains(String varName) {
  final getter = '${InternalIdentifier.getter}$varName';
  final setter = '${InternalIdentifier.setter}$varName';
  final constructor = varName != id
      ? '${InternalIdentifier.namedConstructorPrefix}$varName'
      : InternalIdentifier.defaultConstructor;

  return namespace.symbols.containsKey(varName) ||
      namespace.symbols.containsKey(getter) ||
      namespace.symbols.containsKey(setter) ||
      namespace.symbols.containsKey(constructor);
}