Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow type casting alignment ? #6523

Closed
Alphapage opened this issue Jan 17, 2016 · 7 comments
Closed

Flow type casting alignment ? #6523

Alphapage opened this issue Jan 17, 2016 · 7 comments
Labels
Duplicate An existing issue was already created

Comments

@Alphapage
Copy link

Hello,

Do you plan to implement type casting like in Flow ?

http://flowtype.org/blog/2015/02/18/Typecasts.html

It is related to a previous question :#6519

I think Flow implementation respects more javascript typing philosophy by putting type at the end of the expression.

Thanks in advance for your answers.

@Arnavion
Copy link
Contributor

by putting type at the end of the expression.

So does the as operator that Anders told you about in the other issue.

Are you asking to support Flow's : operator in addition to TS's as operator?

@Alphapage
Copy link
Author

Personally, I hope so if possible for the reason I describe.
I think it would help to implement common rules and let developers choose what typing feature they prefer to remove less used or depreciate them.

@zpdDG4gta8XKpMCd
Copy link

What you are asking is hardly feasible. There is no reason to give 2 syntaxes for the same thing other than to confuse the users. Kind of late to the party.

@zpdDG4gta8XKpMCd
Copy link

Would you elaborate on "javascript typing philosophy". Haven't heard of such. Fascinated to read about it.

@Alphapage
Copy link
Author

C# philosophy: string str; ((string)str) // typing before expression
Javascript philosophy: let str:string; // typing after expression except for type casting should be after too

@zpdDG4gta8XKpMCd
Copy link

FYI, JavaScript doesn't have types to declare and associate with variables.
All you have is a type associated with a value at runtime at a given moment
that can change later which has nothing to do with the pascal style
declarations you referring to.
On Jan 17, 2016 4:50 PM, "Alphapage" notifications@github.com wrote:

C# philosophy: string str; ((string)str) // typing before expression
Javascript philosophy: let str:string; // typing after expression except
for type casting


Reply to this email directly or view it on GitHub
#6523 (comment)
.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Jan 19, 2016
@RyanCavanaugh
Copy link
Member

See discussion in #296 and my comment here #3203 (comment) in particular

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants