[aa-klib-reader] Only resolve symbols from the associated library/sourceFile
Previously the addresses were resolved by only respecting CallableId or ClassId. This however, could lead to resolving symbols that were not defined in the klib which initially provided the declaration address. E.g. this commit adds a test in `GetSymbolsTest`, where ``` // A.kt private fun foo() = 42 // B.kt private fun foo() = 42 ``` In this case the two source files (A.kt and B.kt) defined two distinct addresses for `foo`. However: Resolving any of those two addresses would resolve both functions (A&B), which is not expected. ^KT-66271 Fixed
This commit is contained in:
committed by
Space Team
parent
6b98602afc
commit
426d71b088
@@ -111,11 +111,31 @@ Class (org.jetbrains.sample.b.BClass)
|
||||
Package Name : "org.jetbrains.sample.b"
|
||||
ClassId : "org/jetbrains/sample/b/BClass"
|
||||
|
||||
Class (org.jetbrains.sample.filePrivateSymbolsClash.A)
|
||||
Source File Name : "A.kt"
|
||||
Package Name : "org.jetbrains.sample.filePrivateSymbolsClash"
|
||||
ClassId : "org/jetbrains/sample/filePrivateSymbolsClash/A"
|
||||
|
||||
Property (org.jetbrains.sample.filePrivateSymbolsClash.fooProperty)
|
||||
Source File Name : "A.kt"
|
||||
Package Name : "org.jetbrains.sample.filePrivateSymbolsClash"
|
||||
Property Name : "fooProperty"
|
||||
|
||||
Function (org.jetbrains.sample.filePrivateSymbolsClash.foo)
|
||||
Source File Name : "A.kt"
|
||||
Package Name : "org.jetbrains.sample.filePrivateSymbolsClash"
|
||||
Function Name : "foo"
|
||||
|
||||
Class (org.jetbrains.sample.filePrivateSymbolsClash.B)
|
||||
Source File Name : "B.kt"
|
||||
Package Name : "org.jetbrains.sample.filePrivateSymbolsClash"
|
||||
ClassId : "org/jetbrains/sample/filePrivateSymbolsClash/B"
|
||||
|
||||
Property (org.jetbrains.sample.filePrivateSymbolsClash.fooProperty)
|
||||
Source File Name : "B.kt"
|
||||
Package Name : "org.jetbrains.sample.filePrivateSymbolsClash"
|
||||
Property Name : "fooProperty"
|
||||
|
||||
Function (org.jetbrains.sample.filePrivateSymbolsClash.foo)
|
||||
Source File Name : "B.kt"
|
||||
Package Name : "org.jetbrains.sample.filePrivateSymbolsClash"
|
||||
|
||||
Reference in New Issue
Block a user