Skip to content

Instantly share code, notes, and snippets.

@teamdandelion
Last active June 27, 2018 21:03
Show Gist options
  • Save teamdandelion/309fad904e757ade72ec6753f279ed78 to your computer and use it in GitHub Desktop.
Save teamdandelion/309fad904e757ade72ec6753f279ed78 to your computer and use it in GitHub Desktop.
Broken Flow when using import *
[ignore]
[include]
[libs]
[lints]
[options]
[strict]
// @flow
import * as D from "./dep"
type Entry = D.FooEntry | D.BarEntry;
function address<T: Entry>(e: T): $PropertyType<T, "address"> {
return e.address;
}
// @flow
export type FooAddress = {|
+foo: number;
|};
export type BarAddress = {|
+bar: number;
|};
export type FooEntry = {|
+address: FooAddress,
|};
export type BarEntry = {|
+address: BarAddress,
|};
{
"name": "sadflow",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"flow-bin": "^0.75.0"
}
}
// @flow
import type {FooEntry, BarEntry} from "./dep";
type Entry = FooEntry | BarEntry;
function address<T: Entry>(e: T): $PropertyType<T, "address"> {
return e.address;
}
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
flow-bin@^0.75.0:
version "0.75.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.75.0.tgz#b96d1ee99d3b446a3226be66b4013224ce9df260"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment