Skip to content

Why do we need to import an augmentation if the augmentation refers to the augmented library? #1958

Closed
@mateusfccp

Description

@mateusfccp

In the Augmentation Libraries specification, we have the following:

  • In the augmentation library side, we must declare it as a library augment <main library url>;
  • In the augmented (main) library side, we must import the augmentation with import <augmentation library url>;
  • A given augmentation file can only be used to augment a single library.

This structure is similar with what we have today (part and part of).

However, isn't it redundant to have to import an augmentation if the augmentation can only refer to a single library? In the current proposal, it is possible that an augmentation library exist but the main library does not import it. Does it makes sense? Considering that an augmentation library refer to specifically a single main library, this augmentation library would be completely useless.

For me, the following makes sense:

  • An augmentation library does not need to declare the main library it augments. Instead, any library may import it as an augmentation, as long as the declaration rules are followed;
  • An augmentation library must declare the main library it augments. The main library does not need to import the augmentation library, as it is obviously intended that it should be applied;

I am in favor of the seconds, as the first one would be considerably confusing and it would be fairly rare the cases where an augmentation library would be applicable from more than one main library.

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