diff --git a/CppHeaderParser/CppHeaderParser.py b/CppHeaderParser/CppHeaderParser.py
index 7b07900..cb8fda2 100644
--- a/CppHeaderParser/CppHeaderParser.py
+++ b/CppHeaderParser/CppHeaderParser.py
@@ -1957,6 +1957,7 @@ class _CppHeader(Resolver):
                     "static": 0,
                     "pointer": 0,
                     "reference": 0,
+                    "typedefs": 0,
                 }
                 self.resolve_type(meth["rtnType"], rtnType)
                 if not rtnType["unresolved"]:

diff --git a/test/test_CppHeaderParser.py b/test/test_CppHeaderParser.py
index a876d87..d3f54e7 100644
--- a/test/test_CppHeaderParser.py
+++ b/test/test_CppHeaderParser.py
@@ -3868,5 +3868,30 @@ template <class SomeType> class A {
         self.assertEqual(c["type"], "C")
 
 
+class MoreTypedef(unittest.TestCase):
+    def setUp(self):
+        self.cppHeader = CppHeaderParser.CppHeader(
+            """
+typedef C A;
+
+class B {
+public:
+  A aMethod();
+};
+""",
+            "string",
+        )
+
+    def test_fn(self):
+        c = self.cppHeader.classes["B"]
+        self.assertEqual("B", c["name"])
+
+        m = c["methods"]["public"][0]
+        self.assertEqual(m["name"], "aMethod")
+        self.assertEqual(m["rtnType"], "A")
+
+        self.assertEqual(self.cppHeader.typedefs["A"], "C")
+
+
 if __name__ == "__main__":
     unittest.main()

Another regression in 4.0.0
Following example fails using 4.0.0 and newer (but not with 3.3.0 and older):
```python
import CppHeaderParser

h = """
typedef C A;

class B
{
public:
   A aMethod();
}
"""
CppHeaderParser.CppHeader(h, "string")
```

Following exception is raised:
```bash
Traceback (most recent call last):
  File "ess.py", line 12, in <module>
    CppHeaderParser.CppHeader(h, "string")
  File "/home/thomas/miniconda3/envs/bindgen/lib/python3.7/site-packages/CppHeaderParser/CppHeaderParser.py", line 2981, in __init__
    self.finalize()
  File "/home/thomas/miniconda3/envs/bindgen/lib/python3.7/site-packages/CppHeaderParser/CppHeaderParser.py", line 1936, in finalize
    self.resolve_type(meth["rtnType"], rtnType)
  File "/home/thomas/miniconda3/envs/bindgen/lib/python3.7/site-packages/CppHeaderParser/CppHeaderParser.py", line 1551, in resolve_type
    result["typedefs"] += 1
KeyError: 'typedefs'
```
test/test_CppHeaderParser.py::MoreTypedef::test_fn
test/test_CppHeaderParser.py::functions_TestCase::test_function_name_1 test/test_CppHeaderParser.py::functions_TestCase::test_function_name_2 test/test_CppHeaderParser.py::functions_TestCase::test_num_functions test/test_CppHeaderParser.py::functions2_TestCase::test_function_name_1 test/test_CppHeaderParser.py::functions2_TestCase::test_function_name_2 test/test_CppHeaderParser.py::functions2_TestCase::test_num_functions test/test_CppHeaderParser.py::Macro_TestCase::test_includes test/test_CppHeaderParser.py::Macro_TestCase::test_pragmas test/test_CppHeaderParser.py::Macro_TestCase::test_pragmas0 test/test_CppHeaderParser.py::Macro_TestCase::test_pragmas1 test/test_CppHeaderParser.py::Macro_TestCase::test_pragmas2 test/test_CppHeaderParser.py::FilterMagicMacro_TestCase::test_line_num_is_correct test/test_CppHeaderParser.py::FilterMagicMacro_TestCase::test_method_exists test/test_CppHeaderParser.py::LineNumAfterDivide_TestCase::test_line_num test/test_CppHeaderParser.py::JSON_TestCase::test_hasLemon test/test_CppHeaderParser.py::HALControlWord_TestCase::test_classes test/test_CppHeaderParser.py::HALControlWord_TestCase::test_functions test/test_CppHeaderParser.py::HALControlWord_TestCase::test_num_typedefs test/test_CppHeaderParser.py::CommentEOF_TestCase::test_comment test/test_CppHeaderParser.py::UsingNamespace_TestCase::test_class test/test_CppHeaderParser.py::UsingNamespace_TestCase::test_fn test/test_CppHeaderParser.py::UsingNamespace_TestCase::test_using test/test_CppHeaderParser.py::StaticFn_TestCase::test_fn test/test_CppHeaderParser.py::ConstExpr_TestCase::test_fn test/test_CppHeaderParser.py::DefaultEnum_TestCase::test_fn test/test_CppHeaderParser.py::MultiFile_TestCase::test_fn test/test_CppHeaderParser.py::TemplateMadness_TestCase::testBuildIndexImpl1 test/test_CppHeaderParser.py::TemplateMadness_TestCase::testBuildIndexImpl2 test/test_CppHeaderParser.py::TemplateMadness_TestCase::testConcatIterator test/test_CppHeaderParser.py::TemplateMadness_TestCase::testS test/test_CppHeaderParser.py::TemplateMadness_TestCase::testXYZ test/test_CppHeaderParser.py::Attributes_TestCase::test_existance test/test_CppHeaderParser.py::EnumWithTemplates_TestCase::test_values test/test_CppHeaderParser.py::FreeTemplates_TestCase::test_fn test/test_CppHeaderParser.py::MessedUpDoxygen_TestCase::test_cls test/test_CppHeaderParser.py::MessedUpDoxygen_TestCase::test_cls2 test/test_CppHeaderParser.py::MessedUpDoxygen_TestCase::test_fn test/test_CppHeaderParser.py::MessedUpDoxygen_TestCase::test_var1 test/test_CppHeaderParser.py::MessedUpDoxygen_TestCase::test_var2 test/test_CppHeaderParser.py::EnumParameter_TestCase::test_enum_param test/test_CppHeaderParser.py::EnumParameter_TestCase::test_enum_retval test/test_CppHeaderParser.py::StaticAssert_TestCase::test_nothing test/test_CppHeaderParser.py::InitializerWithInitializerList_TestCase::test_cls_props test/test_CppHeaderParser.py::InitializerWithInitializerList_TestCase::test_future test/test_CppHeaderParser.py::EnumClass_TestCase::test_enum test/test_CppHeaderParser.py::NestedResolving_TestCase::test_nothing test/test_CppHeaderParser.py::EnumCrash_TestCase::test_nothing test/test_CppHeaderParser.py::ExternInline_TestCase::test_fn test/test_CppHeaderParser.py::PointerTemplate_TestCase::test_fn test/test_CppHeaderParser.py::ParamWithInitializer_TestCase::test_fn test/test_CppHeaderParser.py::NestedClassAccess_TestCase::test_fn test/test_CppHeaderParser.py::AnonUnion_TestCase::test_fn test/test_CppHeaderParser.py::Deleted_TestCase::test_fn test/test_CppHeaderParser.py::BaseTemplateNs_TestCase::test_fn test/test_CppHeaderParser.py::NestedTypedef::test_fn