title: Expecting member declaration in Kotlin
body: <p>I want to assign my class variable in constructor, but I get an error 'expecting member declaration'</p>
  <pre class="lang-kotlin prettyprint-override"><code>class YLAService {
  
      var context:Context?=null
  
      class YLAService constructor(context: Context) {
          this.context=context;// do something
      }
  }
  </code></pre>