// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
\page qmllint-warnings-and-errors-enum-entry-matches-enum.html
\ingroup qmllint-warnings-and-errors

\title Enum entry matches enum
\brief [enum-entry-matches-enum] Enum entry should be named differently than the enum itself.

\qmllintwarningcategory enum-entry-matches-enum

\section1 Enum entry should be named differently than the enum itself

\section2 What happened?
An enum has the same name as one of its entries.

\section2 Why is that bad?
There can be ambiguity as to what a lookup resolves to, see example below.

\section2 Example
\qml
// Main.qml
import QtQuick

Item {
    enum E { A, B, C, D, E }
    property var v: Main.E // Does this refer to the enum or to its entry?
}
\endqml
To fix this warning, resolve the name clash by renaming either the enum or the
enum entry:
\qml
// Main.qml
import QtQuick

Item {
    enum Enum { A, B, C, D, E }
    property var v: Main.E // v contains Enum.E. No more ambiguity is possible
}
\endqml
*/
