Dart 3.34 et POO : pb avec le fichier NE_PAS_TOUCHER

Bonjour,

avec Dart v3.34.0, j’ai les erreurs suivantes :

NE_PAS_TOUCHER/user_input.dart:5:16: Error: A value of type ‹ String? › can’t be returned from a function with return type ‹ String › because ‹ String? › is nullable and ‹ String › isn’t.
return stdin.readLineSync();
^
NE_PAS_TOUCHER/user_input.dart:11:22: Error: A value of type ‹ int? › can’t be assigned to a variable of type ‹ int › because ‹ int? › is nullable and ‹ int › isn’t.
typedValue = int.tryParse(readText(question));
^
NE_PAS_TOUCHER/user_input.dart:22:25: Error: A value of type ‹ double? › can’t be assigned to a variable of type ‹ double › because ‹ double? › is nullable and ‹ double › isn’t.
typedValue = double.tryParse(readText(question));

Salut @gilles57

On a traité ce problème dans ce thread :

Merci,

J’avais fait une recherche sur NE_PAS_TOUCHER, mais pas sur NE PAS TOUCHER !
Entre temps j’ai modifié le fichier user_input (malgré l’interdiction :wink: ) et ça fonctionne.

2 « J'aime »