Skip to content

mention strictFunctionTypes#43

Open
Ebuall wants to merge 1 commit into
niieani:masterfrom
Ebuall:master
Open

mention strictFunctionTypes#43
Ebuall wants to merge 1 commit into
niieani:masterfrom
Ebuall:master

Conversation

@Ebuall

@Ebuall Ebuall commented Sep 17, 2018

Copy link
Copy Markdown

Feature from here #20 landed.

@niieani niieani left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Ebuall. Thanks for this, could you make the wording a bit clearer?

Comment thread README.md
[TypeScript proposal](https://github.com/Microsoft/TypeScript/issues/10717)

Bivariance is among [the design decisions](https://github.com/Microsoft/TypeScript/wiki/FAQ#why-are-function-parameters-bivariant) driving TypeScript.
Can be turned off for standalone functions with flag `--strictFunctionTypes` since [Typescript 2.6](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-6.html).

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it's clear what a "standalone" function is. Perhaps it's better to call this "for functions that are not methods". Also, this specifically makes the type checking of functions contravariant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants