Изменяемая переменная 'i' используется недопустимым образом.

Я пытаюсь написать простой код на F #, и я получаю эту ошибку:

Error   1   The mutable variable 'i' is used in an invalid way. Mutable variables may not be captured by closures. Consider eliminating this use of mutation or using a heap-allocated mutable reference cell via 'ref' and '!' 

Код:

let printProcess = async {
        let mutable i = 1;
        while true do
            System.Console.WriteLine(i);//error is here
            i <- i + 1;
    }

Почему он не позволяет мне напечатать переменную?

Ответы на вопрос(1)

Ваш ответ на вопрос