codemix / babel-plugin-typecheck

Static and runtime type checking for JavaScript in the form of a Babel plugin.
MIT License
886 stars 44 forks source link

When custom constructor type is used, it silently fails #40

Closed alex35mil closed 8 years ago

alex35mil commented 8 years ago

When custom constructor type is used, it silently fails:

import { Map as $Map } from 'immutable';

export default function dummiesReducer(
  $state: $Map = $initialState,
  {
    type,
    entities,
  } : {
    type    : string,
    entities: ?$Map, // <--- Object is passed here
  }
) {
  // silently fails here...
}
alex35mil commented 8 years ago

Workaround:

import { Map as $Map } from 'immutable';

function({ entities } : { entities: void | $Map }) {}
phpnode commented 8 years ago

@alexfedoseev this should now be fixed in 3.0.0