Skip to content

Make diagnostics that contain type names more user-friendly and clear #1008

Description

@winterqt

Please describe the bug

Take the following on top of #1007:

diff --git a/std/src/std/uri.inko b/std/src/std/uri.inko
index 3ddc8d240a..ecc76c7377 100644
--- a/std/src/std/uri.inko
+++ b/std/src/std/uri.inko
@@ -1188,7 +1188,7 @@
   #
   # Path.from_slice(comp.slice(0, comp.size - 1).iter) # => Path('a/b/%20')
   # ```
-  fn pub static from_iter[B: Bytes, I: Iter[B]](iter: move I) -> Path {
+  fn pub static from_iter[B: Bytes](iter: move Iter[B]) -> Path {
     let buf = ByteArray.new
     let mut len = 0
 
test/std/test_uri.inko:346:28 error(invalid-type): expected a value of type 'Iter[B]', found 'Iter[String]'

This should instead say something along the lines of traits are forbidden here, did you mean to put it in the generic bounds?. I found it deeply confusing until I realized what was actually going on here. 😅

Operating system

macOS

Inko version

cf08927

Activity

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

    compilerChanges related to the compiler

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions