IssueRaiser

type inference for consts/statics

We shouldn't require types for consts and statics unless necessary. `const FOO = "foo";` or `static bar = 42;` should just work. I propose that we try to infer based only on the RHS, i.e., we do not look at uses of consts/statics. Type error if we can't infer based on that. Although this would break the rule that items must be fully annotated, it would make static/const more consistent with `let`.

Posted by nrc on Oct 31, 2015, 12:50 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.5,000 issues0 comments

github (Other)

type inference for consts/statics

nrcOct 31, 2015, 12:50 PM

We shouldn't require types for consts and statics unless necessary. `const FOO = "foo";` or `static bar = 42;` should just work. I propose that we try to infer based only on the RHS, i.e., we do not look at uses of consts/statics. Type error if we can't infer based on that. Although this would break the rule that items must be fully annotated, it would make static/const more consistent with `let`.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue