Skip to content

Commit

Permalink
test(flow): add multiple declarations regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jul 16, 2019
1 parent 71656ff commit 4c0659d
Show file tree
Hide file tree
Showing 12 changed files with 694 additions and 0 deletions.
@@ -0,0 +1,2 @@
declare class C1 {}
class C1 {}
@@ -0,0 +1,8 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
],
"throws": "Identifier 'C1' has already been declared (2:6)"
}
@@ -0,0 +1,6 @@
declare class C1{}
declare class C1{}

declare module M1 {
declare class C1 {}
}
@@ -0,0 +1,253 @@
{
"type": "File",
"start": 0,
"end": 82,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 6,
"column": 1
}
},
"program": {
"type": "Program",
"start": 0,
"end": 82,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 6,
"column": 1
}
},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "DeclareClass",
"start": 0,
"end": 18,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 18
}
},
"id": {
"type": "Identifier",
"start": 14,
"end": 16,
"loc": {
"start": {
"line": 1,
"column": 14
},
"end": {
"line": 1,
"column": 16
},
"identifierName": "C1"
},
"name": "C1"
},
"typeParameters": null,
"extends": [],
"implements": [],
"mixins": [],
"body": {
"type": "ObjectTypeAnnotation",
"start": 16,
"end": 18,
"loc": {
"start": {
"line": 1,
"column": 16
},
"end": {
"line": 1,
"column": 18
}
},
"callProperties": [],
"properties": [],
"indexers": [],
"internalSlots": [],
"exact": false
}
},
{
"type": "DeclareClass",
"start": 19,
"end": 37,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 18
}
},
"id": {
"type": "Identifier",
"start": 33,
"end": 35,
"loc": {
"start": {
"line": 2,
"column": 14
},
"end": {
"line": 2,
"column": 16
},
"identifierName": "C1"
},
"name": "C1"
},
"typeParameters": null,
"extends": [],
"implements": [],
"mixins": [],
"body": {
"type": "ObjectTypeAnnotation",
"start": 35,
"end": 37,
"loc": {
"start": {
"line": 2,
"column": 16
},
"end": {
"line": 2,
"column": 18
}
},
"callProperties": [],
"properties": [],
"indexers": [],
"internalSlots": [],
"exact": false
}
},
{
"type": "DeclareModule",
"start": 39,
"end": 82,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 6,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 54,
"end": 56,
"loc": {
"start": {
"line": 4,
"column": 15
},
"end": {
"line": 4,
"column": 17
},
"identifierName": "M1"
},
"name": "M1"
},
"body": {
"type": "BlockStatement",
"start": 57,
"end": 82,
"loc": {
"start": {
"line": 4,
"column": 18
},
"end": {
"line": 6,
"column": 1
}
},
"body": [
{
"type": "DeclareClass",
"start": 61,
"end": 80,
"loc": {
"start": {
"line": 5,
"column": 2
},
"end": {
"line": 5,
"column": 21
}
},
"id": {
"type": "Identifier",
"start": 75,
"end": 77,
"loc": {
"start": {
"line": 5,
"column": 16
},
"end": {
"line": 5,
"column": 18
},
"identifierName": "C1"
},
"name": "C1"
},
"typeParameters": null,
"extends": [],
"implements": [],
"mixins": [],
"body": {
"type": "ObjectTypeAnnotation",
"start": 78,
"end": 80,
"loc": {
"start": {
"line": 5,
"column": 19
},
"end": {
"line": 5,
"column": 21
}
},
"callProperties": [],
"properties": [],
"indexers": [],
"internalSlots": [],
"exact": false
}
}
]
},
"kind": "CommonJS"
}
],
"directives": []
}
}
@@ -0,0 +1,3 @@
declare function F1(): void
declare function F1(): void
function F1() {}

0 comments on commit 4c0659d

Please sign in to comment.