Swift: Fix for getFullName.

This commit is contained in:
Geoffrey White
2023-03-21 14:36:21 +00:00
parent 29f7862466
commit 91c324ea4f
2 changed files with 4 additions and 1 deletions

View File

@@ -28,8 +28,11 @@ class TypeDecl extends Generated::TypeDecl {
cached
string getFullName() {
not this.getEnclosingDecl() instanceof TypeDecl and
not this.getEnclosingDecl() instanceof ExtensionDecl and
result = this.getName()
or
result = this.getEnclosingDecl().(TypeDecl).getFullName() + "." + this.getName()
or
result = this.getEnclosingDecl().(ExtensionDecl).getExtendedTypeDecl().getFullName() + "." + this.getName()
}
}

View File

@@ -6,4 +6,4 @@
| abstractfunctiondecl.swift:21:2:21:16 | func5() | MethodDecl, getName:func5(), hasName:func5(), hasQualifiedName(2):Class3.func5(), hasQualifiedName(3):abstractfunctiondecl.Class3.func5(), memberOf:Class3 |
| abstractfunctiondecl.swift:25:2:25:16 | func6() | MethodDecl, getName:func6(), hasName:func6(), hasQualifiedName(2):Struct1.func6(), hasQualifiedName(3):abstractfunctiondecl.Struct1.func6(), memberOf:Struct1 |
| abstractfunctiondecl.swift:31:2:31:16 | func7() | MethodDecl, getName:func7(), hasName:func7(), hasQualifiedName(2):Enum1.func7(), hasQualifiedName(3):abstractfunctiondecl.Enum1.func7(), memberOf:Enum1 |
| abstractfunctiondecl.swift:37:3:37:17 | func8() | MethodDecl, getName:func8(), hasName:func8(), hasQualifiedName(2):Class4.func8(), hasQualifiedName(3):abstractfunctiondecl.Class4.func8(), memberOf:Class4 |
| abstractfunctiondecl.swift:37:3:37:17 | func8() | MethodDecl, getName:func8(), hasName:func8(), hasQualifiedName(2):Class1.Class4.func8(), hasQualifiedName(3):abstractfunctiondecl.Class1.Class4.func8(), memberOf:Class1.Class4 |