1

Currently I'm experimenting and learning the Dart language.

I'm creating an abstract class with two abstract methods called IAnimal like this:

abstract class IAnimal
{
  String Walk(int distance);

  String Eat(String food);
}

Next I create a Dog class that should implement the 2 methods.

class Dog implements IAnimal
{
  Dog(String name) {
    this._name = name;
  }

  String _name;
}

But the dart analyser does complain about the 2 missing methods, is this intended behaviour or not supported?

Luc Wollants
  • 880
  • 9
  • 27
  • What IDE and Dart version are you using? – Günter Zöchbauer Jun 11 '15 at 17:22
  • Dart VM version: 1.10.0 (Fri Apr 24 17:32:20 2015) on "macos_x64", tried it in WebStorm 10.0.3 and Sublime Text with the dart plugin. From the command line it is working. – Luc Wollants Jun 11 '15 at 17:32
  • Had the same issue with WebStorm 10.0.3 on Windows 8 at work. – Luc Wollants Jun 11 '15 at 17:39
  • Does WebStorm show the `Dart Analysis` view? AFAIK the Dart analyzer only starts when you edit a file. If you just opened the project containing the buggy code without editing anything the analyzer doesn't start. – Günter Zöchbauer Jun 11 '15 at 17:44
  • 1
    Opening the Dart Analysis view, which I did not know about, solved the problem in WebStorm! Removing my old obsolete link to the Dartium browser in Sublime Text also fixed that issue! Up and running now with nice interface warnings. Thanks! – Luc Wollants Jun 11 '15 at 17:48

2 Answers2

0

Here it shows a warning DartPad maybe the analyzer doesn't run or isn't finished yet.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
0

This should indeed give a warning, the Dart Analyzer from the command line does the trick. This was an issue with WebStorm and Sublime Text not triggering the Dart Analyzer.

Luc Wollants
  • 880
  • 9
  • 27