You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Traits] Disallow disabling default traits of a package without traits
# Motivation
Traits are a great way for package authors to offer customization of the functionality they provide. However, moving existing API behind a trait is considered an API breaking change since packages that depend on them might have disabled all default traits. This makes it almost impossible for existing packages to adopt traits for existing code.
# Modifications
This PR disallows disabling the default traits for packages with no traits at all. This allows package authors to move existing API behind traits once since no consumer can disable the default traits before.
# Result
With this change we create a migration path for existing packages to traits without them breaking their APIs.
Disabled default traits by package '\(parentPackage)' on package '\(packageName)' that declares no traits. This is prohibited to allow packages to adopt traits initially without causing an API break.
error: Disabled default traits by package 'disablingemptydefaultsexample' on package 'Package11' that declares no traits. This is prohibited to allow packages to adopt traits initially without causing an API break.
0 commit comments