diff --git a/sphinx_js/typedoc.py b/sphinx_js/typedoc.py index 0041a150..38abf1ea 100644 --- a/sphinx_js/typedoc.py +++ b/sphinx_js/typedoc.py @@ -959,14 +959,11 @@ def inner(param: Param) -> Iterator[str | ir.TypeXRef]: yield ") => " return_type = self.return_type(converter) if return_type: - ret = return_type[0].type + res = return_type[0].type + assert isinstance(res, list) + yield from res else: - ret = "void" - assert ret - if isinstance(ret, str): - yield ret - else: - yield from ret + yield ir.TypeXRefIntrinsic("void") def to_ir( self, converter: Converter @@ -1135,11 +1132,11 @@ class LiteralType(TypeBase): def _render_name_root(self, converter: Converter) -> Iterator[str | ir.TypeXRef]: if self.value is None: - yield "null" + yield ir.TypeXRefIntrinsic("null") return # TODO: it could be a bigint or a string? if isinstance(self.value, int): - yield "number" + yield ir.TypeXRefIntrinsic("number") return yield "" return diff --git a/tests/test_typedoc_analysis/test_typedoc_analysis.py b/tests/test_typedoc_analysis/test_typedoc_analysis.py index 5078353d..9567dd69 100644 --- a/tests/test_typedoc_analysis/test_typedoc_analysis.py +++ b/tests/test_typedoc_analysis/test_typedoc_analysis.py @@ -291,7 +291,7 @@ def test_interface_function_member(self): def test_variable(self): """Make sure top-level consts and vars are found.""" const = self.analyzer.get_object(["topLevelConst"]) - assert const.type == ["number"] + assert const.type == [TypeXRefIntrinsic("number")] def test_function(self): """Make sure Functions, Params, and Returns are built properly for