Skip to content

More specific errors for kind check failures #12201

Closed

Description

@nikomatsakis

Today if a type is not Send (or whatever) you get a rather terse error message informing you of that fact, but no clue as to why a type isn't send. It shouldn't be too hard to walk over the type, identifying a specific path that leads to a non-sendable type. (Same holds for linearity etc)

I'm happy to mentor, so tagging as E-mentor.

cc @larsbergstrom

Activity

  1. nikomatsakis commented on Feb 12, 2014

    @nikomatsakis
    ContributorAuthor

    This was discussed some on IRC. To clarify the consensus, the basic strategy we had in mind is to:

    1. Refactor TypeContents into a visitor that walks the, well, type contents.
    2. TypeContents uses this visitor to compute its bitsets.
    3. In the case of an error, a separate path of code uses the visitor to walk down and compute a "path" from the type to the smallest error case. Something like "this is not send because x.y.z is not sendable". This path probably has the same form as the paths that the borrow checker reports, though it may not use the same data structures.

    The reason for this approach is that we do not want to compute nor store the full paths in the normal case, since TypeContents are computed for a LOT of types, and only a very few of them have errors.

  2. self-assigned this
    on Mar 24, 2014
  3. nikomatsakis commented on Jan 16, 2015

    @nikomatsakis
    ContributorAuthor

    @flaper87 did this as part of the OIBIT work.

  4. added a commit that references this issue on Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions