Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

Incorrect design type is built for Array<>, starts from 0.18.0 #162

Open
likerRr opened this issue Jun 16, 2016 · 6 comments
Open

Incorrect design type is built for Array<>, starts from 0.18.0 #162

likerRr opened this issue Jun 16, 2016 · 6 comments

Comments

@likerRr
Copy link

likerRr commented Jun 16, 2016

I have a class where I defined a property such way:

private pickupPoints: Array<PickupPointView>;

ATL v0.17.0 produces this code:
0_17_0

ATL v0.18.0+ (up to v1) produces this code:
0_18_0

What's interesting, that if I define property such way:

private pickupPoints: PickupPointView[];

and build it with v0.18.0 then it will produce Array design type as expected.

Why does it happen and what array notation should I use: Array<any> or any[]?

@s-panferov
Copy link
Owner

@likerRr which typescript version do you use?

@likerRr
Copy link
Author

likerRr commented Jun 16, 2016

@s-panferov sorry, v1.8.10

@likerRr
Copy link
Author

likerRr commented Jun 24, 2016

@s-panferov any updates?

@s-panferov
Copy link
Owner

@likerRr I think that error is in TypeScript itself microsoft/TypeScript#9232

Loader right now tries to use isolatedModules and fast transpileModules emit. I'll create a flag to disable the feature.

@niieani
Copy link

niieani commented Jul 22, 2016

Any updates on this? The TypeScript bug seems to have been closed, but I still get incorrect metadata when using TypeScript@next (e.g. Object instead of Element which is declared in lib.dom.d.ts).
I've tried setting disableFastEmit to true, to no avail.

@niieani
Copy link

niieani commented Jul 22, 2016

I did two tests:

  1. Adding a triple slash reference:

    /// <reference path="../node_modules/typescript/lib/lib.dom.d.ts" />

    Does not help unfortunately :(

  2. Declare Element in file:

    declare var Element: {
        prototype: Element;
        new(): Element;
    }

    This does work!

So it seems like the library files are not being added to the list of compilation files, hence the emitted metadata defaults to Object instead.

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

No branches or pull requests

3 participants