Skip to content

Instantly share code, notes, and snippets.

@mieszko4
Created December 13, 2020 12:49
Show Gist options
  • Save mieszko4/e322f00ab8ccdcff8ae5ee7921526f6d to your computer and use it in GitHub Desktop.
Save mieszko4/e322f00ab8ccdcff8ae5ee7921526f6d to your computer and use it in GitHub Desktop.

Revisions

  1. mieszko4 created this gist Dec 13, 2020.
    8 changes: 8 additions & 0 deletions confused.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    type A = {a: 'a'} | {b: 'b'};

    const c: A = {
    a: 'a',
    b: 'b'
    };
    type C = typeof c; // === A
    // Confused TS: I cannot access c.a nor c.b