This repository has been archived by the owner on May 19, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix handling of anonymous parameters in `flowParseObjectTypeMethodish…
- Loading branch information
1 parent
54399ab
commit 3715f4a
Showing
3 changed files
with
240 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
type o = { m(|int|bool): void } |
238 changes: 238 additions & 0 deletions
238
test/fixtures/flow/object-types/complex-param-types/expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,238 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 31, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 31 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 31, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 31 | ||
} | ||
}, | ||
"sourceType": "module", | ||
"body": [ | ||
{ | ||
"type": "TypeAlias", | ||
"start": 0, | ||
"end": 31, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 31 | ||
} | ||
}, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 5, | ||
"end": 6, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 6 | ||
}, | ||
"identifierName": "o" | ||
}, | ||
"name": "o" | ||
}, | ||
"typeParameters": null, | ||
"right": { | ||
"type": "ObjectTypeAnnotation", | ||
"start": 9, | ||
"end": 31, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 9 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 31 | ||
} | ||
}, | ||
"callProperties": [], | ||
"properties": [ | ||
{ | ||
"type": "ObjectTypeProperty", | ||
"start": 11, | ||
"end": 29, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 11 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 29 | ||
} | ||
}, | ||
"key": { | ||
"type": "Identifier", | ||
"start": 11, | ||
"end": 12, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 11 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 12 | ||
}, | ||
"identifierName": "m" | ||
}, | ||
"name": "m" | ||
}, | ||
"static": false, | ||
"kind": "init", | ||
"value": { | ||
"type": "FunctionTypeAnnotation", | ||
"start": 11, | ||
"end": 29, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 11 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 29 | ||
} | ||
}, | ||
"params": [ | ||
{ | ||
"type": "FunctionTypeParam", | ||
"start": 13, | ||
"end": 22, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 13 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 22 | ||
} | ||
}, | ||
"name": null, | ||
"optional": false, | ||
"typeAnnotation": { | ||
"type": "UnionTypeAnnotation", | ||
"start": 13, | ||
"end": 22, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 13 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 22 | ||
} | ||
}, | ||
"types": [ | ||
{ | ||
"type": "GenericTypeAnnotation", | ||
"start": 14, | ||
"end": 17, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 14 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 17 | ||
} | ||
}, | ||
"typeParameters": null, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 14, | ||
"end": 17, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 14 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 17 | ||
}, | ||
"identifierName": "int" | ||
}, | ||
"name": "int" | ||
} | ||
}, | ||
{ | ||
"type": "BooleanTypeAnnotation", | ||
"start": 18, | ||
"end": 22, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 18 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 22 | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"rest": null, | ||
"typeParameters": null, | ||
"returnType": { | ||
"type": "VoidTypeAnnotation", | ||
"start": 25, | ||
"end": 29, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 25 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 29 | ||
} | ||
} | ||
} | ||
}, | ||
"optional": false | ||
} | ||
], | ||
"indexers": [], | ||
"exact": false | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |