title: Scala implicit error with implicit parameter
body: <p>I have the following in my file</p>
  <pre><code>import cats._
  import cats.syntax.all._
  
  implicit val showPrimaryFieldSchema: Show[PrimaryFieldSchema] = pf =&gt; {
          s&quot;PRIMARY_ID ${pf.fName} ${pf.fType.show}&quot;
      }
  </code></pre>
  <p>when i write the following:</p>
  <pre><code>implicit def showVertexSchema(implicit pShow: Show[PrimaryFieldSchema], npShow: Show[NonPrimaryFieldSchema] ): Show[VertexSchema] = vSchema =&gt; {
          s&quot;&quot;&quot;VERTEX ${vSchema.vName} (${vSchema.pField.show}, ${vSchema.nPFields.map(np =&gt; npShow.show(np)).mkString(&quot;, &quot;)}) WITH primary_id_as_attribute=&quot;FALSE&quot;&quot;&quot;&quot;
      }
  </code></pre>
  <p>I get the following error:</p>
  <blockquote>
  <p>value show is not a member of com.elsevier.entellect.tigergraph.schemabuilder.DataTypes.PrimaryFieldSchema
  [error]         s&quot;&quot;&quot;VERTEX ${vSchema.vName} (${vSchema.pField.show}, ${vSchema.nPFields.map(np =&gt; npShow.show(np)).mkString(&quot;, &quot;)}) WITH primary_id_as_attribute=&quot;FALSE&quot;&quot;&quot;&quot;</p>
  </blockquote>
  <p>However the following code works:</p>
  <pre><code>implicit def showVertexSchema(implicit pShow: Show[PrimaryFieldSchema], npShow: Show[NonPrimaryFieldSchema] ): Show[VertexSchema] = vSchema =&gt; {
          s&quot;&quot;&quot;VERTEX ${vSchema.vName} (${pShow.show(vSchema.pField)}, ${vSchema.nPFields.map(np =&gt; npShow.show(np)).mkString(&quot;, &quot;)}) WITH primary_id_as_attribute=&quot;FALSE&quot;&quot;&quot;&quot;
      }
  </code></pre>
  <p>So I wonder really why</p>
  <pre><code>vSchema.pField.show
  </code></pre>
  <p>not ok at all here. <code>implicit pShow: Show[PrimaryFieldSchema]</code> is a category1 implicit, and a parameter. so not sure</p>
  <p>Can someone explain ?</p>
  <h1>EDIT1</h1>
  <pre><code>sealed trait Schema
  final case class VertexSchema(vName: String, pField: PrimaryFieldSchema, nPFields: List[NonPrimaryFieldSchema]) extends Schema
  final case class EdgePairSchema(FROM: VertexSchema, TO: VertexSchema)
  final case class EdgeSchema(eName: String, pairs: List[EdgePairSchema], fields: List[NonPrimaryFieldSchema], Directed: Boolean, erName: Option[String]) extends Schema
  final case class GraphSchema(gName: String, vertexSchemas: List[VertexSchema] = List(), edgeSchemas: List[EdgeSchema] = List()) extends Schema
  
  sealed trait FieldSchema
  final case class PrimaryFieldSchema(fName: String, fType: FieldType, index: Boolean = false) extends FieldSchema
  final case class NonPrimaryFieldSchema(fName: String, fType: FieldType, index: Boolean = false) extends FieldSchema
  
  sealed trait FieldType
  sealed trait SimpleFieldType extends FieldType
  final case object INT extends SimpleFieldType
  final case object UINT extends SimpleFieldType
  final case object FLOAT extends SimpleFieldType
  final case object DOUBLE extends SimpleFieldType
  final case object BOOL extends SimpleFieldType
  final case object STRING extends SimpleFieldType
  final case object DATETIME extends SimpleFieldType
  sealed trait ComplexFieldType extends FieldType
  final case class LIST(fieldType: SimpleFieldType) extends ComplexFieldType
  final case class SET(fieldType: SimpleFieldType)  extends ComplexFieldType
  
  
  
  implicit val showINTType: Show[INT.type] = _.toString
  implicit val showUINTType: Show[UINT.type] = _.toString
  implicit val showFLOATType: Show[FLOAT.type] = _.toString
  implicit val showDOUBLEType: Show[DOUBLE.type] = _.toString
  implicit val showBOOLType: Show[BOOL.type] = _.toString
  implicit val showSTRINGType: Show[STRING.type] = _.toString
  implicit val showDATETIMEType: Show[DATETIME.type] = _.toString
  implicit val showLISTType : Show[LIST] = list =&gt; s&quot;LIST&lt;${list.fieldType.toString}&gt;&quot;
  implicit val showSETType : Show[SET] = set =&gt; s&quot;SET&lt;${set.fieldType.toString}&gt;&quot;
  
  implicit val showFieldType: Show[FieldType] = {
      case INT =&gt; INT.show
      case UINT =&gt; UINT.show
      case FLOAT =&gt; FLOAT.show
      case BOOL =&gt; BOOL.show
      case DOUBLE =&gt; DOUBLE.show
      case STRING =&gt; STRING.show
      case DATETIME =&gt; DATETIME.show
      case list@LIST(_) =&gt; list.show
      case set@SET(_) =&gt; set.show
  }
  
  
  implicit val showPrimaryFieldSchema: Show[PrimaryFieldSchema] = pf =&gt; {
      s&quot;PRIMARY_ID ${pf.fName} ${pf.fType.show}&quot;
  }
  
  implicit val showNonPrimaryFieldSchemaa: Show[NonPrimaryFieldSchema] = pf =&gt; {
      s&quot;${pf.fName} ${pf.fType.show}&quot;
  }
  
  implicit def showVertexSchema(implicit pShow: Show[PrimaryFieldSchema], npShow: Show[NonPrimaryFieldSchema] ): Show[VertexSchema] = vSchema =&gt; {
      s&quot;&quot;&quot;VERTEX ${vSchema.vName} (${pShow.show(vSchema.pField)}, ${vSchema.nPFields.map(np =&gt; npShow.show(np)).mkString(&quot;, &quot;)}) WITH primary_id_as_attribute=&quot;FALSE&quot;&quot;&quot;&quot;
  }
  </code></pre>
  <h1>EDIT2</h1>
  <p>Same problem happen is i first comment out</p>
  <pre><code>/*implicit val showPrimaryFieldSchema: Show[PrimaryFieldSchema] = pf =&gt; {
      s&quot;PRIMARY_ID ${pf.fName} ${pf.fType.show}&quot;
  }*/
  </code></pre>
  <p>and then i do</p>
  <pre><code>implicit def showVertexSchema(implicit pShow: Show[PrimaryFieldSchema], npShow: Show[NonPrimaryFieldSchema] ): Show[VertexSchema] = vSchema =&gt; {
  
      implicit val showPrimaryFieldSchema1: Show[PrimaryFieldSchema] = pf =&gt; {
          s&quot;PRIMARY_ID ${pf.fName} ${pf.fType.show}&quot;
      }
  
      s&quot;&quot;&quot;VERTEX ${vSchema.vName} (${vSchema.pField.show}, ${vSchema.nPFields.map(np =&gt; npShow.show(np)).mkString(&quot;, &quot;)}) WITH primary_id_as_attribute=&quot;FALSE&quot;&quot;&quot;&quot;
  }
  //&gt; value show is not a member of A$A7.this.PrimaryFieldSchema
  
  </code></pre>
  <p>then if i remove the implicit value but only keep the parameter, of course it works as a charm.</p>
  <p>There seem to be an issue with the fact that 2 implicit of the same precedence are in scope maybe ?</p>
  <h1>EDIT3</h1>
  <p>I added the following scalac option and i get</p>
  <pre><code>toShow is not a valid implicit value for vSchema.pField.type =&gt; ?{def show: ?} because:
  ambiguous implicit values:
   both lazy value showPrimaryFieldSchema in class A$A31 of type cats.Show[A$A31.this.PrimaryFieldSchema]
   and value pShow of type cats.Show[A$A31.this.PrimaryFieldSchema]
   match expected type cats.Show[A$A31.this.PrimaryFieldSchema]
      s&quot;&quot;&quot;VERTEX ${vSchema.vName} (${vSchema.pField.show}, ${vSchema.nPFields.map(np =&gt; npShow.show(np)).mkString(&quot;, &quot;)}) WITH primary_id_as_attribute=&quot;FALSE&quot;&quot;&quot;&quot;
  
  This is the kind of feedback i would expect per default. 
  
  However is that correct, i do not really get the implicit resolution rule here. Doesn't precedence play ?
  </code></pre>