Skip to content

Imported services without compiled container #203

Description

@mabar

Version: 3.0.0

In some very simple tests we create container directly instead of a compiled container

		$logger = new Logger('foo');
		$container = new Container();
		$container->addService('foo', $logger);

this causes error Nette\DI\Container::addService() service 'foo' should be defined as 'imported', but it is not possible without compilation of container.

Imho error should be triggered only if container is compiled (self::class !== static::class?)

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