Scala Named method arguments cannot resolve symbol

12/13/2018

I am trying to use named arguments for the method because it has quite a lot of arguments. I am using java-client for Kubernetes API. However, I get Cannot resolve symbol compile error. I am writing the code in Intellij IDEA, could it be some plugins problem?

Here is the code:

  def createWatchOnPodsCalls() = {
    client.getHttpClient.setReadTimeout(0, TimeUnit.MILLISECONDS)
    val watchEvents: Watch[V1Namespace]  = Watch.createWatch(client,
apiInstance.listClusterCustomObjectCall(group=null, version=null, plural=null, pretty="true", labelSelector = null, resourceVersion = null, watch = false, progressListener = null, progressRequestListener = null),
      new TypeToken[Watch.Response[V1Namespace]]{}.getType)
    watchEvents
  }
-- Cassie
intellij-idea
kubernetes
scala

1 Answer

12/13/2018

Scala 2.12 supports named parameters for Java if they are available, but by default Java is compiled without storing parameter names. So most Java libraries don't have them (because the benefit in Java itself is minimal), including even the standard library (unless that has changed recently).

-- Alexey Romanov
Source: StackOverflow