Confidenceman02 / django-elm

A framework for using Elm programs in Django
MIT License
29 stars 1 forks source link

GenerateModelStrategy error - Name clash #70

Closed Confidenceman02 closed 6 months ago

Confidenceman02 commented 8 months ago

Fuzz tests found that the following flag:

            {
                "a": ObjectFlag({"options": ObjectFlag({"name": StringFlag()})}),
                "b": ListFlag(
                    ObjectFlag({"options": ObjectFlag({"name": StringFlag()})})
                ),
            }

Fails to compile with the following error:

NAME CLASH - This file defines multiple `Options__` types.

Looks like we will have to make nested objects a bit more unique.

We can add the alias name to the start of the object:

type alias A_Options__ =
    {
    ...
    }

type alias B_Options__ = 
    {
    ...
    }

It's uglier but does disambiguate between objects that have the same Type name.