Skip to content

Instantly share code, notes, and snippets.

@akaptur
Created December 14, 2021 01:00
Show Gist options
  • Save akaptur/e986a737d77903d167c4d9c70ca75569 to your computer and use it in GitHub Desktop.
Save akaptur/e986a737d77903d167c4d9c70ca75569 to your computer and use it in GitHub Desktop.
type A = {
value: string;
};
type B = {
value: string;
};
function my_func(a: A): string {
return a.value;
}
my_func({value: "hi"}); // no error here!
const b: B = {value: "hi"};
my_func(b); // no error here either!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment