Skip to content

Should type aliases for type constructors be a warning? #2936

@justinwoo

Description

@justinwoo

From #2932

In short, since we don't have some kind of consensus on this from people participating in the pull request, I think we should try to poll users in some way.

Just a reminder that I only mean to target things like type URL = String with this, nothing more fancy. The main motivation being that I often have shot my feet off doing this in my own code, and there's not much reason to when one can easily consume APIs that expose newtypes (e.g. Pattern is only P-A-T-[completion]-enter or wrap away), not to mention libs that don't export constructors for values that should be validated (like URLs, FilePaths, and the like) are easier to use for the vast majority of cases.

Any aliasing of type constructors like this that shouldn't throw a warning are basically impossible to handle without knowing the user intent or doing some ugly hardcoded list or something.

Please do say if I've forgotten to say anything here, and if there'd be a good way to get people to respond and talk about their own issues.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions