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

Anonymous interfaces embedded in other interfaces should be type-checked #172

Closed
zakjan opened this issue May 21, 2017 · 1 comment
Closed

Comments

@zakjan
Copy link

zakjan commented May 21, 2017

item.ts

export interface Item {
    attributes: {
        name: string;
    };
}

test.ts

import {Item} from "./item";

export class TestViewModel {
    item: Item;
}

test.html

<template>
    ${item.attributes.aaa}
</template>

This should throw a warning about missing attribute aaa, but it is not detected.


Note that if I extract attributes object into a separate interface, it starts working.

item.ts

export interface ItemAttributes {
    name: string;
}

export interface Item {
    attributes: ItemAttributes;
}

cannot find 'aaa' in type 'ItemAttributes' Ln 3 Col 5 /src/demo/vm/data/test.html

In this case, I think that message "cannot find 'attributes.aaa' in type 'Item'" would be more helpful, because anyway that's the same message that will probably be displayed in the first case.

@zakjan
Copy link
Author

zakjan commented Jul 3, 2017

Duplicate of #65, closing.

@zakjan zakjan closed this as completed Jul 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant