When you try to create an abstract class, like this:
```
import std;
abstract class A
{
abstract void foo();
}
class B : A
{
}
void main()
{
B b = new B();
}
```
you get this error:
```
onlineapp.d(15): Error: cannot create instance of abstract class `B`
onlineapp.d(15): function `void foo()` is not implemented
```
Note that it points to where the class is being created (line 15), not to the class `B` itself where the erorr happens. I think a reference to where class `B` is defined should be added. It will be convenient for IDEs to ctrl + click to follow where the class `B` is defined.
Also, "function `void foo()` is not implemented" should point to line 5, the place where the abstract function is defined.
Comment #1 by dlang-bot — 2023-07-27T15:36:14Z
@dkorpel created dlang/dmd pull request #15463 "Fix 24060 - Improve "Cannot create instance of abstract class" error" fixing this issue:
- Fix 24060 - Improve "Cannot create instance of abstract class" error
https://github.com/dlang/dmd/pull/15463
Comment #2 by dlang-bot — 2023-07-28T08:17:27Z
dlang/dmd pull request #15463 "Fix 24060 - Improve "Cannot create instance of abstract class" error" was merged into master:
- ea1e3fac48da2ca59d62b5e6dd723db9278edc1e by Dennis Korpel:
Fix 24060 - Improve "Cannot create instance of abstract class" error
https://github.com/dlang/dmd/pull/15463