Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-7391

Fix problem with "Attempt to redefine entity" when using type aliases as class parameter

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 4.10.0
    • None
    • None
    • Puppet Developer Experience
    • 1
    • PDE 2017-04-05
    • Bug Fix
    • Hide
      An error with "Attempt to redefine entity" could occur in some cases when a type alias was resolved. This occurred if a module's init.pp would also reference and resolve the same type and if that init.pp needed to be loaded to resolve the type in the first place. This problem is now fixed.
      Show
      An error with "Attempt to redefine entity" could occur in some cases when a type alias was resolved. This occurred if a module's init.pp would also reference and resolve the same type and if that init.pp needed to be loaded to resolve the type in the first place. This problem is now fixed.
    • No Action
    • covered by unit tests

    Description

      If a function parameter declaration or return type, references a type that has not yet been loaded, and that type is prefixed with the name of a module that has not yet been loaded, then the loaders will first make an attempt to load the files in the modules manifests directory. If such a file, in turn, also references the same type, then that triggers a recursive load. When the recursive call returns, the loader will still try to add the type, which results in an "Attempt to redefine entity" error.

      Attachments

        Activity

          People

            Unassigned Unassigned
            thomas.hallgren Thomas Hallgren
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support