Skip to content

Instantly share code, notes, and snippets.

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