Skip to content

Instantly share code, notes, and snippets.

@aliceklipper
Created April 12, 2017 12:06
Show Gist options
  • Save aliceklipper/207b6f032ad3ba9f5963e760ecbb9d94 to your computer and use it in GitHub Desktop.
Save aliceklipper/207b6f032ad3ba9f5963e760ecbb9d94 to your computer and use it in GitHub Desktop.
Here at lines 26 and 27 are type errors.
// @flow
function MSasaiable (constructor) {
return class extends constructor {
sasai (string : string) {
return `Sasai ${string}!`;
}
};
}
function MKudasaiable (constructor) {
return class extends constructor {
kudasai (string : string) {
return `Kudasai ${string}.`;
}
};
}
function MSasaiableKudasaiable (constructor) {
return MSasaiable(MKudasaiable(constructor));
}
const SasaiableKudasaiable = MSasaiableKudasaiable(class {});
const sasaiableKudasaiable = new SasaiableKudasaiable();
console.log(sasaiableKudasaiable.sasai(1));
console.log(sasaiableKudasaiable.kudasai(null));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment