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

Mismatched types do not have line number #65514

Closed
patientplatypus opened this issue Oct 17, 2019 · 2 comments
Closed

Mismatched types do not have line number #65514

patientplatypus opened this issue Oct 17, 2019 · 2 comments

Comments

@patientplatypus
Copy link

patientplatypus commented Oct 17, 2019

error[E0308]: mismatched types
  |
  = note: expected type `()`
             found type `std::vec::Vec<u8>`

^ That is incredibly frustrating.

EDIT:

Turns out that for macros this is an issue apparently (I asked on freenode).

#[wasm_bindgen]
pub extern fn handle_mouse_down_stroke(stroke_type: String, stroke_size: u32, stroke_rgba: Vec<u8>, canvas_width: u32, canvas_height: u32, x: u32, y: u32)
-> Vec<u8>

vs

#[wasm_bindgen]
pub extern fn handle_mouse_down_stroke(stroke_type: String, stroke_size: u32, stroke_rgba: Vec<u8>, canvas_width: u32, canvas_height: u32, x: u32, y: u32)
// -> Vec<u8>

This gives an error. This narrows down the field of bad error messages, but it is still an open issue.

@Mark-Simulacrum
Copy link
Member

I suspect this is fixed now on nightly -- the extern fn syntax previously caused macro expansion to lose spans, but should no longer do so I believe (I don't have time to hunt down the PR).

Can you check on nightly?

@Mark-Simulacrum
Copy link
Member

Ah, I did not remember correctly. This is tracked in #64561.

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