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

type missmatch error for channel directions should be actionable #1407

Closed
proppy opened this issue May 15, 2024 · 1 comment
Closed

type missmatch error for channel directions should be actionable #1407

proppy opened this issue May 15, 2024 · 1 comment
Labels
bug Something isn't working or is incorrect dslx DSLX (domain specific language) implementation / front-end

Comments

@proppy
Copy link
Member

proppy commented May 15, 2024

Describe the bug
Type missmatch errors for in out direction on channels don't actually show the channel kind:

xls/examples/proc_iota.x:54:27-54:28
0052:     let (s, r) = chan<u32>("my_chan");
0053:     spawn producer(s);
0054:     spawn consumer<u32:2>(r);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ XlsTypeError: Mismatch between parameter and argument types (after instantiation).
Mismatched elements within type:
Overall type mismatch:
   chan(uN[32])
vs chan(uN[32])
0055:     ()
0056:   }

making it hard to identify and fix the actual error.

To Reproduce
apply the following diff to proc_iota.x

diff --git a/xls/examples/proc_iota.x b/xls/examples/proc_iota.x
index 503612ba7..91c6073c2 100644
--- a/xls/examples/proc_iota.x
+++ b/xls/examples/proc_iota.x
@@ -35,7 +35,7 @@ proc consumer<N:u32> {
 
   init { u32: 0 }
 
-  config(input_r: chan<u32> in) {
+  config(input_r: chan<u32> out) {
     (input_r,)
   }
 

Expected behavior

The error include the channel direction.

@proppy proppy added bug Something isn't working or is incorrect dslx DSLX (domain specific language) implementation / front-end labels May 15, 2024
@proppy
Copy link
Member Author

proppy commented May 24, 2024

dupe of #1392

@proppy proppy closed this as completed May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or is incorrect dslx DSLX (domain specific language) implementation / front-end
Projects
None yet
Development

No branches or pull requests

1 participant