This project is read-only.
1
Vote

Nested call to non-existent ctor gives nonsensical quick fix

description

Source:
class X {
    X(string x) {
        new X(new string());
    }
}
The quick fix in the middle line will offer to create X(string), even though that (a) already exists and (b) has nothing to do with the original error.

In other scenarios (I'm not sure exactly why), it generated a parameterless ctor with :base().

comments

SSL wrote Nov 17, 2014 at 4:41 AM

Even worse:
abstract class Y {
    class X : Y {
        void M() { new X(new string()); }
    }
}
Quick fix generates
public X() : base() {
}