title: Typescript: Are computed object keys actively allowed?
body: <p>The following compiles fine in Typescript 2.5.3:</p>
  
  <pre><code>interface Test {
    test: string
  }
  
  const anything = 'someDifferentKey';
  
  const a: Test = {
    [anything]: true, // no error
    test: 'whatever'
  }
  </code></pre>
  
  <p>But this doesn't:</p>
  
  <pre><code>interface Test {
    test: string
  }
  
  const a: Test = {
    someDifferentKey: true, // error
    test: 'whatever'
  }
  </code></pre>
  
  <p>My question is - is it 'safe' to rely on computed object keys <em>always</em> being allowed to tag along with a typed object definition, or are computed properties <strong>based on constant vales</strong> (e.g. <code>"some"+"differentKey"</code> or the <code>anything</code> const referenced above) simply ignored for now because of a limitation of the current Typescript compiler?</p>
  
  <p><strong>Edit for clarification:</strong></p>
  
  <p>Read the above as: <em>"Does the TS spec give me any guarantee that dynamic properties won't ever cause a compilation error?"</em> per Juan Mendes' comment.</p>