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

Allow compile-time computable expressions to initialize ambient consts #6804

Closed
RyanCavanaugh opened this issue Feb 1, 2016 · 0 comments
Closed
Labels
Declined The issue was declined as something which matches the TypeScript vision Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Help Wanted You can do this Suggestion An idea for TypeScript

Comments

@RyanCavanaugh
Copy link
Member

To support #6678, allow const declarations in ambient contexts to have compile-time computable initializers:

// foo.d.ts
const x = 'hello'; // OK
const y = 'hello ' + 'world' // OK
const z = 'hello'.substr(3); // Error

const a = 10; // OK
const b = 10 + 10; // OK
// Rest of rules follow from 'const enum' rules

const m = true; // OK
const n = false; // OK
@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript Help Wanted You can do this Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". labels Feb 1, 2016
@RyanCavanaugh RyanCavanaugh added this to the Community milestone Feb 1, 2016
@RyanCavanaugh RyanCavanaugh modified the milestones: Community, Backlog Mar 7, 2019
@RyanCavanaugh RyanCavanaugh closed this as not planned Won't fix, can't repro, duplicate, stale Mar 12, 2024
@RyanCavanaugh RyanCavanaugh removed this from the Backlog milestone Mar 12, 2024
@RyanCavanaugh RyanCavanaugh added the Declined The issue was declined as something which matches the TypeScript vision label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Declined The issue was declined as something which matches the TypeScript vision Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Help Wanted You can do this Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

1 participant