Skip to content

Fail to generate a reflected interface in a namespace #122

@ppoulard

Description

@ppoulard

In the playground :

import { reflect } from 'typescript-rtti';

namespace shape {
    export interface Shape {
        bar: string
    }
    // export const foo = 42;
}
const sh = reflect<shape.Shape>().as('interface').reflectedInterface;
console.log(sh.getProperty('bar')?.type ?? '<NOT FOUND>')

This gives the following output :

=============
Caught error: Type has kind undefined, expected interface
TypeError: Type has kind undefined, expected interface

This is because the namespace is NOT in the value space ; however, if you uncomment the other export, the namespace is in the value space and it doesn't fail any longer

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