Skip to content

TS does not pick errors in submodel snapshots #262

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

Closed
xaviergonz opened this issue Jul 21, 2017 · 2 comments
Closed

TS does not pick errors in submodel snapshots #262

xaviergonz opened this issue Jul 21, 2017 · 2 comments

Comments

@xaviergonz
Copy link
Contributor

xaviergonz commented Jul 21, 2017

Using TS 2.4.1 I just noticed this

const ModelA = types.model(
  'A',
  {
    aNumb: 1
  }, {});

const ModelB = types.model(
  'B',
  {
    bNumb: 10,
    aInstance: ModelA
  }, {});

const bInstance = ModelB.create({
  bNumb: 'abc', // this should be an error since c is not a number, but it is not reported
  xxx: 100, // this is correctly reported as not being part of ModelB
  aInstance: {
    xxx: 4, // this is NOT correctly reported as not being part of ModelA
  }
});
@mattiamanzati
Copy link
Contributor

That's a known issue due to a TS limitation :/ Its currently tracked in #117 :)

@xaviergonz
Copy link
Contributor Author

Ah, ok, I saw it, but I wasn't sure what it meant exactly

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

2 participants