Skip to content

Can't rename classes #727

Closed
Closed

Description

@hadley

While verifying scenarios for the evolution vignette (#143): renaming a class breaks downstream packages even when the old name is kept as an exported alias (Foo <- Bar), if they refer to the class with new_external_class("pkgA", "Foo"):

Error: Package 'pkgA' must export `Foo` as the S7 class <pkgA::Foo>.

resolve_external_class_req() requires identical(obj@name, name) && identical(obj@package, package), which an alias to the renamed class can't satisfy.

I suggest we drop this check.

Activity

  1. changed the title [-]Let new_external_class() resolve through an exported alias, so classes can be renamed[/-] [+]Can't rename classes[/+] on Jul 27, 2026
  2. hadley commented on Jul 27, 2026

    @hadley
    MemberAuthor

    We might also want to provide a deprecated_class() a la #730.

  3. added a commit that references this issue on Oct 2, 2026
    245aaf4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions