Skip to content

Type mismatch error should have spans if it's too long #21025

Closed
@Manishearth

Description

@Manishearth
error: mismatched types: expected `session_types::Session<session_types::Cap<(), session_types::Rec<session_types::Offer<_, session_types::Rcv<collections::string::String, session_types::Choose<session_types::Snd<_, _>, session_types::Snd<_, session_types::Offer<_, session_types::Rcv<collections::string::String, session_types::Choose<session_types::Snd<(), _>, session_types::Snd<_, session_types::Rec<session_types::Offer<_, session_types::Offer<_, session_types::Snd<collections::string::String, session_types::Eps>>>>>>>>>>>>>>, (), _>`, found `session_types::Session<session_types::Cap<(), session_types::Rec<session_types::Offer<session_types::Snd<collections::string::String, session_types::Eps>, session_types::Rcv<collections::string::String, session_types::Choose<session_types::Snd<collections::string::String, session_types::Var<session_types::Z>>, session_types::Snd<collections::string::String, session_types::Offer<session_types::Snd<collections::string::String, session_types::Eps>, session_types::Rcv<collections::string::String, session_types::Choose<session_types::Snd<collections::string::String, session_types::Var<session_types::Z>>, session_types::Snd<collections::string::String, session_types::Rec<session_types::Offer<session_types::Snd<isize, session_types::Snd<isize, session_types::Var<session_types::Z>>>, session_types::Offer<session_types::Rcv<isize, session_types::Choose<session_types::Snd<collections::string::String, session_types::Snd<collections::string::String, session_types::Var<session_types::Z>>>, session_types::Snd<collections::string::String, session_types::Var<session_types::Z>>>>, session_types::Snd<collections::string::String, session_types::Eps>>>>>>>>>>>>>>, (), ()>` (expected (), found struct collections::string::String) 

It would be useful if there was a note as to where the () and String from (expected (), found struct collections::string::String) were for large types.

An additional note that's shown when the error report is above x (300?) characters which highlights the mismatched types (using something like our ^~~~~~ for code spans) would be useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions