Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type alias should be expanded to show the details #331

Open
ChristophP opened this issue Mar 6, 2020 · 1 comment
Open

Type alias should be expanded to show the details #331

ChristophP opened this issue Mar 6, 2020 · 1 comment

Comments

@ChristophP
Copy link

ChristophP commented Mar 6, 2020

Problem: Often while developing I find myself getting an error like this:

Compiling ...-- TYPE MISMATCH ------------------------------------------ src/Page/Results.elm

The 4th argument to `createSegments` is not what I expect:

134|             , Api.createSegments token apiBaseUrl CreateSegmentsResponse payload
                                                                              ^^^^^^^
This `payload` value is a:

    { combinationId : String }

But `createSegments` needs the 4th argument to be:

    Api.CreateSegmentsPayload

Hint: I always figure out the argument types from left to right. If an argument
is acceptable, I assume it is “correct” and move on. So the problem may actually
be in one of the previous arguments!

Hint: Looks like the segments field is missing.

Detected problems in 1 module.

The relevant bit here is shown below. It is telling me about a name of a type alias but not he structure. Most of the time I already know the name of the type alias but I want to know what the structure needs to be exactly.

This `payload` value is a :

    { combinationId : String }

But `createSegments` needs the 4th argument to be:

    Api.CreateSegmentsPayload

This is especially problematic with typos. Say my type alias is a record of 10 fields but one has a typo it is hard to figure out when you cannot really compare what you have to what it needs to be visually and makes one looks where the definition is instead.

Improvement suggestion Display the structure details or even better which fields did not line up, displaying typos and type mismatches on a field level.

@Janiczek
Copy link

Yes please. This is very common and showing both types at the same level of expansion would help greatly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants