Skip to content

declare module parsed as namespace #1284

@arnog

Description

@arnog

This input:

declare module "m" {
  export function f();
}

generates this JSON output:

{
	"id": 0,
	"name": "",
	"kind": 0,
	"flags": {},
	"originalName": "",
	"children": [
		{
			"id": 1,
			"name": "\"m\"",
			"kind": 2,
			"kindString": "Namespace",
			"flags": {
				"isExported": true
			},
			"children": [
				{
					"id": 2,
					"name": "f",
					"kind": 64,
					"kindString": "Function",
					"flags": {
						"isExported": true
					},
					"signatures": [
						{
							"id": 3,
							"name": "f",
							"kind": 4096,
							"kindString": "Call signature",
							"flags": {
								"isExported": true
							},
							"type": {
								"type": "intrinsic",
								"name": "any"
							}
						}
					],
				}
			],
			"groups": [
				{
					"title": "Functions",
					"kind": 64,
					"children": [
						2
					]
				}
			],
		}
	],
	"groups": [
		{
			"title": "Namespaces",
			"kind": 2,
			"children": [
				1
			]
		}
	]
}

I was expecting reflection with id = 1 to be of kind = 1 (module), not of kind = 2 (namespace)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions