title: Kotlin: Type mismatch: inferred type is String but String.Companion was expected
body: <p>Error in Line 5 and 6.</p>
  
  <blockquote>
    <p>Kotlin: Type mismatch: inferred type is String but String.Companion
    was expected</p>
  </blockquote>
  
  <pre><code>class Robot (name: String,color :String) {
  
      var roboName= String
      var roboColor= String
      init {
          this.roboName=name
          this.roboColor=color
          }
      fun makeBed()
      {
          println("I will make your bed.")
  
      }
  
  }
  fun main(args: Array&lt;String&gt;){
  
       var robot1=Robot("Robot1","Black")
        println(robot1.roboName)
        println(robot1.roboColor)
        robot1.makeBed()
  }
  </code></pre>