code: private void checkDeclaredPropertyAgainstPrototypalInheritance(
        Node n,
        ObjectType receiverType,
        String propertyName,
        @Nullable JSDocInfo info,
        JSType propertyType) {
      // TODO(nickreid): Right now this is only expected to run on ctors. However, it wouldn't be bad
      // if it ran on more things. Consider a precondition on the arguments.
  
      boolean declaredOverride = declaresOverride(info);
      @Nullable
      ObjectType supertypeWithProperty =
          Streams.stream(receiverType.getImplicitPrototypeChain())
              // We want to report the supertype that actually had the overidden declaration.
              .filter((type) -> type.hasOwnProperty(propertyName))
              // We only care about the lowest match in the chain because it must be the most
              // specific.
              .findFirst()
              .orElse(null);
  
      if (supertypeWithProperty == null) {
        if (declaredOverride) {
          compiler.report(
              JSError.make(
                  n, //
                  UNKNOWN_PROTOTYPAL_OVERRIDE,
                  propertyName,
                  receiverType.toString()));
        }
      } else {
        if (!declaredOverride) {
          compiler.report(
              JSError.make(
                  n, //
                  HIDDEN_PROTOTYPAL_SUPERTYPE_PROPERTY,
                  propertyName,
                  supertypeWithProperty.toString()));
        }
  
        JSType overriddenPropertyType = supertypeWithProperty.getPropertyType(propertyName);
        if (!propertyType.isSubtypeOf(overriddenPropertyType)) {
          compiler.report(
              JSError.make(
                  n,
                  HIDDEN_PROTOTYPAL_SUPERTYPE_PROPERTY_MISMATCH,
                  propertyName,
                  supertypeWithProperty.toString(),
                  overriddenPropertyType.toString(),
                  propertyType.toString()));
        }
      }
    }
docs: Given a {@code receiverType}, check that the property ({@code propertyName}) conforms to
  inheritance rules.
  
  <p>This method only checks prototypal inheritance (via the prototype chain). Compare to {@link
  #checkDeclaredPropertyAgainstNominalInheritance()}.
  
  <p>To be conformant, the {@code propertyName} must
  
  <ul>
  <li>Carry the {@code @override} annotation iff it is an override.
  <li>Be typed as a subtype of the type of {@code propertyName} on all supertypes of {@code
  receiverType}.
  </ul>