Skip to content

Commit

Permalink
Fix issue with recursive call check if only a single SyntheticResolve…
Browse files Browse the repository at this point in the history
…Extension is registered #28
  • Loading branch information
rickclephas committed Dec 22, 2021
1 parent b6d4293 commit c1a5ce7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class KmpNativeCoroutinesComponentRegistrar: ComponentRegistrar {
val suffix = configuration.get(SUFFIX_KEY) ?: return
val nameGenerator = NameGenerator(suffix)
SyntheticResolveExtension.registerExtension(project, KmpNativeCoroutinesSyntheticResolveExtension(nameGenerator))
SyntheticResolveExtension.registerExtension(project, KmpNativeCoroutinesSyntheticResolveExtension.RecursiveCallSyntheticResolveExtension())
IrGenerationExtension.registerExtension(project, KmpNativeCoroutinesIrGenerationExtension(nameGenerator))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ internal class KmpNativeCoroutinesSyntheticResolveExtension(
NoLookupLocation.WHEN_GET_ALL_DESCRIPTORS) as MutableSet<DeclarationDescriptor>
}

// We need two extensions so that we can check for recursion calls with `syntheticResolveExtensionClassName`.
class RecursiveCallSyntheticResolveExtension : SyntheticResolveExtension

private val syntheticResolveExtensionClassName =
"org.jetbrains.kotlin.resolve.extensions.SyntheticResolveExtension\$Companion\$getInstance\$1"

Expand Down

0 comments on commit c1a5ce7

Please sign in to comment.