Skip to content

Type mismatch reported for interpolated strings with multiple % specifiers in IDE checking #20752

Description

@auduchinok

Consider this code:

let flag = true
let s = $"%b{flag} %b{flag}"

It compiles fine with fsc, but ParseAndCheckFileInProject reports an error on the string:

Error FS0001 : Type mismatch. Expecting a
    'bool -> string'    
but given a
    'bool -> bool -> string'    
The type 'string' does not match the type 'bool -> string'

It happens when there are two or more % specifiers and at least one of them is not a bare %s/%c/%d/%i/%M, i.e. %b, %A, %f or %5d.

This seems to be a regression in #19971. Initially reported as RIDER-143926.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions