Skip to content

Conversation

@edgarfgp
Copy link
Contributor

@edgarfgp edgarfgp commented Aug 27, 2023

As discovered by failing test on FsAutoComplete in F# 8 we no longer show FS0725 in cases where it is supposed to.

module Tests
    type A = { X: int }
    type B = B of int
    match None with
    | None 1 -> ()  // FS0725
    
    match None with
    | None (1, 2) -> () // FS0725
    
    match None with
    | None [] -> () // FS0725
    
    match None with
    | None [||] -> () // FS0725
    
    match None with
    | None { X = 1 } -> () // FS0725
    
    match None with
    | None (B 1) -> ()   // FS0725
    
    match None with
    | None (x, y) -> ()  // FS0725
    
    match None with
    | None false -> ()  // FS0725

    match None with
    | None x -> ()  //FS0725
    
    match None with
    | None _ -> ()  // F#7 this compiles. In F#8 this shows FS3548
    
    type C = | C
    
    let myDiscardedArgFunc(C _) = ()  // F#7 this compiles. In F#8 this shows FS3548
    
    let myDiscardedArgFunc2(C c) = ()  // FS0725

PR that introduced the regression #14055

@edgarfgp edgarfgp requested a review from a team as a code owner August 27, 2023 12:57
@edgarfgp
Copy link
Contributor Author

edgarfgp commented Aug 27, 2023

On a second look while working on this fix. I think for

    match None with
    | None x -> ()  // In F#8 this shows Warning FS3548 instead of Error FS0725 ? I think is should as it was in F#7
    
    type C = | C
        
    let myDiscardedArgFunc2(C c) = () // In F#8 this shows Warning FS3548 instead of Error FS0725 ? I think is should be as it was in F#7

Any thoughts? cc @vzarytovskii

@vzarytovskii
Copy link
Member

On a second look while working on this fix. I think for

    match None with
    | None x -> ()  // In F#8 this shows Warning FS3548 instead of Error FS0725 ? I think is should as it was in F#7
    
    type C = | C
        
    let myDiscardedArgFunc2(C c) = () // In F#8 this shows Warning FS3548 instead of Error FS0725 ? I think is should be as it was in F#7

Any thoughts? cc @vzarytovskii

Yeah, I guess we shouldn't downgrade error to warning here.

@edgarfgp
Copy link
Contributor Author

edgarfgp commented Aug 27, 2023

On a second look while working on this fix. I think for

    match None with
    | None x -> ()  // In F#8 this shows Warning FS3548 instead of Error FS0725 ? I think is should as it was in F#7
    
    type C = | C
        
    let myDiscardedArgFunc2(C c) = () // In F#8 this shows Warning FS3548 instead of Error FS0725 ? I think is should be as it was in F#7

Any thoughts? cc @vzarytovskii

Yeah, I guess we shouldn't downgrade error to warning here.

Also the FS3548 error message does not really match what is happening here

Update: FS3548 imo is really about discard _

@edgarfgp
Copy link
Contributor Author

This is ready

@vzarytovskii vzarytovskii enabled auto-merge (squash) August 28, 2023 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants