@Override
  public JvmConstructorDefinition resolveConstructorCall(List<ActualParam> actualParams) {
    // all named parameters should be after the named ones
    if (!ParamUtils.verifyOrder(actualParams)) {
      throw new IllegalArgumentException(
          "Named params should all be grouped after the positional ones");
    }

    ensureIsInitialized(symbolResolver());
    Optional<InternalConstructorDefinition> constructor =
        constructors.stream().filter((c) -> c.match(symbolResolver(), actualParams)).findFirst();

    if (!constructor.isPresent()) {
      throw new UnsolvedConstructorException(getQualifiedName(), actualParams);
    }

    return constructor.get().getJvmConstructorDefinition();
  }
  @Override
  public Optional<InternalMethodDefinition> findMethod(
      String methodName, List<ActualParam> actualParams, boolean staticContext) {
    // all named parameters should be after the named ones
    if (!ParamUtils.verifyOrder(actualParams)) {
      throw new IllegalArgumentException(
          "Named params should all be grouped after the positional ones");
    }

    ensureIsInitialized(symbolResolver());
    if (!methodsByName.containsKey(methodName)) {
      return Optional.empty();
    }
    Optional<InternalMethodDefinition> method =
        methodsByName
            .get(methodName)
            .stream()
            .filter((m) -> m.match(symbolResolver(), actualParams))
            .findFirst();
    return method;
  }