The critical point to keep in mind here is that you should NOT jump into doing an intermittant fast if you are diabetic AND are taking any of the following pills that lower blood sugar: gliclazide, glibenclamide, glipizide. (These are the sulfonylurea pills.) If you are taking repaglinide with meals. it may be possible to fast if you skip the repaglinide on fast days.
It may also be impossible to fast if you are using any of the basal insulins like Lantus, Levemir, or NPH unless you understand how to adjust your dose on your own. Even then, because of the way these insulins work, it may not be possible to get them to work with intermittent fasting schedules.
That is because all these drugs are dosed with the assumption that you are eating carbs throughout the day. If you aren't, they continue to lower your blood sugar which can give you nasty hypos.
If you are using Byetta (exenatide) or Victoza, Januvia, Onglyza, Trajenta, or combo pills with these drugs in them it probably isn't dangerous to fast as they don't lower blood sugar when you aren't eating the way the first batch of pills I listed do.
If you aren't taking the drugs that lower blood sugar in the absence of food, you CAN fast even with a diabetes diagnosis. Though you should test your sugar during the fasting part of the day because some people with diabetes will see their blood sugar shoot up as they fast. In that case, eat a small breakfast, then fast.
It is perfectly safe to fast while taking metformin, in fact, metformin makes fasting extremely easy as it tends to eliminate the hunger that drives so much overeating.
It is so annoying the way that doctors will make these blanket statements because they don't have the patience to explain the actual facts to people. For that matter, it's annoying that doctors don't explain to patients what exactly it is that the drugs they prescribe do to lower their blood sugar. That's a whole nother topic. But if people understood the mechanisms of these drugs and their actual, proven side effects, they would be much more aggressive in demanding only the safer drugs on offer.