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

Type aliases #7

Open
Naddiseo opened this issue Jun 8, 2015 · 3 comments
Open

Type aliases #7

Naddiseo opened this issue Jun 8, 2015 · 3 comments

Comments

@Naddiseo
Copy link
Collaborator

Naddiseo commented Jun 8, 2015

This really depends on how deeply the type hinting is. If the hint is just the superficial/toplevel/boxed/primitive type, then aliases aren't really needed. However, if anything further is allowed, then I think aliases would definitely be helpful, especially with callback functions.

@lukescott
Copy link
Owner

I'm not sure if aliases are needed. And they somewhat already exist is ES6 import:

import {AliasFoo as default} from "foo";

function doSomethingWithAliasFoo(foo AliasFoo) {...}

@Naddiseo
Copy link
Collaborator Author

Naddiseo commented Jun 9, 2015

As mentioned in #4, If TypeHint is a LeftHandSideExpression then a type alias can be boiled down to:

const AliasType = OtherType;

And if types are then stripped out after checking, the aliases should also be removed by inlining and dead-code elimination.

@Naddiseo
Copy link
Collaborator Author

Let's leave this out for now. If developers and tool creators want this feature, then we can revisit the issue.

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

No branches or pull requests

2 participants