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

Error quality: function parameter list does not flag an unknown type #1623

Open
joshring opened this issue Nov 14, 2024 · 4 comments
Open

Error quality: function parameter list does not flag an unknown type #1623

joshring opened this issue Nov 14, 2024 · 4 comments
Labels
Enhancement Request New feature or request

Comments

@joshring
Copy link
Contributor

import std::time;

def Picoev_loop_id_t = ushort;

struct Picoev_loop {
    // read only
    Picoev_loop_id_t    loop_id;
    struct timeout {
        short*          vec;
        short*          vec_of_vec;
        usz             base_idx;
        time::Time      base_time;
        int             resolution;
        void*           _free_addr;
    }
    time::Time          now;
}

fn void picoev_set_timeout(
    picoev_loop* loop, // incorrect code
    // Picoev_loop* loop,  // correct code
    int fd, 
    int secs,
) @inline 
{
 return;
}

I expected it to determine picoev_loop was not a valid type, but I got this error instead:

Error: Expected ')'.

@lerno
Copy link
Collaborator

lerno commented Nov 14, 2024

That one is hard. picoev_loop will be understood to be a macro parameter name, so it could only be followed by =, , or )

@joshring
Copy link
Contributor Author

Q: would a macro parameter be unexpected in a function parameter list? could that be an error itself?

@lerno
Copy link
Collaborator

lerno commented Nov 14, 2024

It's usually resolved in semantic checking.

@lerno
Copy link
Collaborator

lerno commented Nov 16, 2024

So essentially I don't know if there is a great way to resolve this.

@lerno lerno added the Enhancement Request New feature or request label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants