Skip to content

Bug with class_alias #156

Description

@enumag
  • bug report? yes
  • feature request? no
  • version: 2.4.8

Description

Nette/DI seems to be incompatible with class aliases. My tests are failing with this error:

[Nette\DI\ServiceCreationException] Service 'arachne.forms.twig.extension.translation': Case mismatch on class name 'Twig\NodeVisitor\NodeVisitorInterface', correct name is 'Twig_NodeVisitorInterface'.

Obviously there is no case mismatch. It's just that Twig\NodeVisitor\NodeVisitorInterface is an alias of Twig_NodeVisitorInterface which confuses ContainerBuilder::checkCase().

Steps To Reproduce

Create a class and an alias to that class. Add it to DIC as service. Try to autowire it into another service using the alias instead of the base class. EDIT: See the test case in my PR.

Activity

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