Skip to content

Default function and conflicts detection #1800

@SomMeri

Description

@SomMeri

1.) This is considered to be ambiguous, but I do not think it should be:

guard-default-expr-not {
    .m(@x)                      {case:     1}
    .m(@x) when (default())     {default: @x}
    .m(@x) when not(default())  {not-default: @x}

    .m(2);
}

error:

RuntimeError: Ambiguous use of `default()` found when matching for `.m(2)` in test.less on line 6, column 5:
5
6     .m(2);
7 }

Expected result:

guard-default-expr-not {
  case: 1;
  not-default: 2;
}

2-question.) This is considered ambiguous too, was that intentional? It more or less makes sense either way.

guard-default-expr-not {
    .m(@x) when not(default())  {not-default-1: @x}
    .m(@x) when not(default())  {not-default-2: @x}

    .m(2);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions