Wrong error with ?: expressions

Observed The error Type of conditional '{}' must be identical to 'X', 'X' or 'typeof X'. from the following (bad) code: enum X { A, B, C } var s: string; var x = X; x = s == "a" ? X.A : s == ...

Id #2449 | Release: None | Updated: Today at 4:02 PM by AdamFreidin | Created: Today at 4:02 PM by AdamFreidin

Require with non-relative path can pull in unexpected code

If a require statement has a non-relative path (eg. require('mymod') ) then tsc will search all directories from the container of the requiring file all the way up to the file system root for a cor...

Id #2448 | Release: None | Updated: Today at 1:39 PM by robertknight | Created: Today at 1:38 PM by robertknight

FileReader readAsArrayBuffer() and File

The following lines of code var fileReader: FileReader = new FileReader(); var file: File = input.files[0]; fileReader.readAsArrayBuffer(file); produce the error Type 'File' is missing property '...

Id #2446 | Release: None | Updated: Fri at 9:40 PM by danquirk | Created: Fri at 8:26 PM by codebrewery

Generic types of default parameters in functions are not verified.

Consider the following example: export interface B<a, b> { one: a; another: b; } function toVal<a>() : a { return null; } var t1 = toVal<B<string>>(); // Fails export function t2( value = toVal<...

Id #2445 | Release: None | Updated: Fri at 8:12 PM by AdamFreidin | Created: Fri at 3:43 PM by middlewest

Feature Request: Generic Parameter Overloads (post-V1.0)

The suggestion is to allow generic parameter overloads like the following: declare module Backbone { class Model{} class Events{} class ViewOptions<TModel extends Model> {} class Collection<TModel...

Id #2438 | Release: None | Updated: Thu at 8:56 PM by ivogabe | Created: Mon at 7:53 PM by omidkrad

static class members can leak module-private types

Running typescript --declaration on module X { enum PrivateEnum { A, B, C }; export class UsesPrivateEnum { static LeakPrivateEnum = PrivateEnum; // : typeof PrivateEnum } } produces the de...

Id #2437 | Release: None | Updated: Tue at 4:53 PM by AdamFreidin | Created: Mon at 5:47 PM by AdamFreidin

Conditional Types

I think more control over classes and modules, such as "if (true) class T { }" or "if (true) module T { }" should be allowed. This may be a good way to load a whole minified script WITHOUT also ex...

Id #2432 | Release: None | Updated: Mon at 11:50 PM by jamesnw | Created: Mon at 7:23 AM by jamesnw

indexer parameters comments lost

The "string param" comment on the indexer parameter is being discarded in this test case https://typescript.codeplex.com/SourceControl/latest#tests/cases/compiler/commentsInterface.ts /** this is...

Id #2431 | Release: None | Updated: Tue at 10:44 PM by AdamFreidin | Created: Apr 13 at 7:39 PM by AdamFreidin

cloneNode should return sub type, not Node

When I do someElement.cloneNode(), I want the returned element to be the same type as someElement, but right now it's returning type Node.

Id #2428 | Release: None | Updated: Mon at 4:03 PM by RyanCavanaugh | Created: Apr 13 at 7:37 AM by davidomundo

Suggestion: Anonymous/Unnamed Modules

Original discussion: https://typescript.codeplex.com/discussions/425937 Hi, thanks for the great work on TypeScript. I'm liking it more than any other languages that compile to JS. I would like ...

Id #2424 | Release: None | Updated: Apr 13 at 2:16 PM by jbondc | Created: Apr 11 at 11:25 PM by omidkrad