gccrs icon indicating copy to clipboard operation
gccrs copied to clipboard

Empty ```TupleStructPattern``` assumed to be function call

Open powerboat9 opened this issue 1 year ago • 2 comments

I tried this code:

struct S();

pub fn main() {
    match S() {
        S() => {}
    }
}

I expected to see this happen: no error

Instead, this happened:

<source>:5:9: error: expected tuple struct or tuple variant, found associated function [E0164]
    5 |         S() => {}
      |         ^
      |         function calls are not allowed in patterns

powerboat9 avatar Feb 12 '24 18:02 powerboat9

interesting, thanks :) this might be a name resolution issue

CohenArthur avatar Feb 13 '24 11:02 CohenArthur

Can I work on this? :)

beelchester avatar Feb 14 '24 01:02 beelchester