I wrote this code

```
interface Foo {
    abcdef: number;
}

let x: Foo | string;

if (x instanceof Foo) {
    // ...
}

```

But TypeScript gave me this error:

```
'Foo' only refers to a type, but is being used as a value here.

```

Why is this happening? I thought that `instanceof` could check whether my value has a given type, but TypeScript seems not to like this.