Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#20,752 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
fsharp
Ambito
compilers

Direzione di ricerca

Start by reproducing the error with the snippet in the issue, using ParseAndCheckFileInProject in the language service rather than fsc. The report says this regressed in #19971, so check that change first to see how interpolated format strings are type-checked. Done means $"%b{flag} %b{flag}" type-checks without error in the IDE path and the existing interpolation tests still pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug Needs-Triage

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.

Lingua principale
F#
Stelle
4.3k
Fork
880
Merge medio
4g 9h
PR unite (30g)
117

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di dotnet/fsharp

Tutte le issue di dotnet/fsharp

Issue simili

Altre issue su Compilers

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.