Skip to content

Union type doesn't work when containing an imported type from another module which is dependent on the current module #3368

@jddxf

Description

@jddxf

Consider the following two modules:

/**
 * @providesModule ModuleA
 * @flow
 */

var ModuleB = require('./ModuleB');
export type A = number;
/**
 * @providesModule ModuleB
 * @flow
 */

import type { A } from './ModuleA';
module.exports = function () {
  var a: A | null = 's';
}

Flow is expected to report an error but it doesn't.It only does when I change the type annotation on a from A | null to A or when type A is declared in ModuleB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions