Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Fix interop declarations generation #4572

Merged
merged 2 commits into from
Dec 3, 2020

Conversation

sbogolepov
Copy link
Contributor

No description provided.

This reverts commit 9c1fc56
symbol = symbolTable.referenceConstructor(enumDescriptor.unsubstitutedPrimaryConstructor!!),
typeArgumentsCount = 0 // enums can't be generic
symbol = constructorSymbol,
typeArgumentsCount = constructorSymbol.owner.typeParameters.size,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constructors can't have any type parameters unless they are declared in Java which is impossible on Native.

@@ -80,7 +81,8 @@ internal class CEnumClassGenerator(
createEnumEntry(descriptor, entryDescriptor)
}
enumClassMembersGenerator.generateSpecialMembers(enumIrClass)
enumIrClass.addChild(cEnumCompanionGenerator.generate(enumIrClass))
enumIrClass.addChild(cEnumCompanionGenerator.
generate(enumIrClass))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor. Coding style is a bit broken

Current approach to generate interop enum and structs during linkage stage turned out to be fragile. We might get unbound wrapper descriptors which are useless for function body generation.
The solution is to postpone body generation until linkage step is complete.
@sbogolepov sbogolepov force-pushed the sbogolepov/fix-wrapped-discroptors branch from f9a15fc to a965235 Compare December 3, 2020 13:44
@sbogolepov sbogolepov merged commit a012e23 into master Dec 3, 2020
@sbogolepov sbogolepov deleted the sbogolepov/fix-wrapped-discroptors branch December 3, 2020 13:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants