I have the following issue with the Second Generation Package, I have this Apex class:
global with sharing class TestClass {
global virtual class B {
}
global class C1 extends B {
}
global class C2 extends B {
}
}
On the foobarbaz namespace, in a managed package, I upload and release a first managed version (v1.0.0) and then, without changing any code at all, I try to create a new minor version (v1.1.0) that have for ancestor the v1.0.0 but I'm getting the following error when I try to create the version:
TestClass: Supertype, foobarbaz.TestClass, relationship must be maintained: foobarbaz.TestClass.C1,TestClass: Supertype, foobarbaz.TestClass, relationship must be maintained: foobarbaz.TestClass.C2
I tested creating a minor version without changing the code source with the First Generation Package, and it's working fine.
So, what's the issue there?
Edit: Here's a Minimium Reproducible Case repository https://github.com/louis-bompart/sturdy-funicular
It's a simple sfdx project setup with sfdx-cli and the aforementioned Apex class. The first commit is the first release (v1.0.0) The second commit is the second attempted release. (v1.1.0)
Edit2: The ancestory tree: https://docs.google.com/drawings/d/10bbSnR5wB1mgfuGNJ3fz_YLEYC-ahevnjqbmZyHECDw/edit?usp=sharing Here's some more elaborated steps on how to reproduce: After the package is created, but no version exists yet:
- sfdx force:package:version:create -p FooBazBar -v mydevhub@foo.com -x -c
- sfdx force:package:version:promote --package 04tmypackageid -v mydevhub@foo.com
- Update sfdx-project.json by adding "ancestorVersion": "0.1.0.1" in the only packageDirectory
- sfdx force:package:version:create -p FooBazBar -v mydevhub@foo.com -x -c
- Crash