// 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-duplicate-inline-components.html
\ingroup qmllint-warnings-and-errors

\title Duplicate inline components
\brief [duplicate-inline-components] Duplicate inline component.

\qmllintwarningcategory duplicate-inline-component

\section1 Duplicate inline component

\section2 What happened?
Two inline components have the same name.

\section2 Why is that bad?
One name refers to more than one type and causes an ambiguity. This will fail
to compile.

\section2 Example
\qml
import QtQuick

Item {
    component R : Rectangle { color: "red" }
    component R : Rectangle { color: "blue" } // Fail to compile
}
\endqml
To fix this warning, remove or rename one of the inline components:
\qml
import QtQuick

Item {
    component RedRectangle : Rectangle { color: "red" }
    component BlueRectangle : Rectangle { color: "blue" }
}
\endqml
*/
