T
Thomas Tryde
Simplified code.
class A : object {
m() {}
}
class B : objet {
m() {}
}
class Test {
Test() {
object var = RANDOM ? new A() : new B();
var.m(); // Compiler Error CS0117
}
}
How can I get this functionality to work without a compiler
error (it works excellent in VB.Net).
Another example:
object db = RANDOM ? new SqlConnection() : new
OleDbConnection();
....
....
db.Open(); // Compiler Error CS0117
class A : object {
m() {}
}
class B : objet {
m() {}
}
class Test {
Test() {
object var = RANDOM ? new A() : new B();
var.m(); // Compiler Error CS0117
}
}
How can I get this functionality to work without a compiler
error (it works excellent in VB.Net).
Another example:
object db = RANDOM ? new SqlConnection() : new
OleDbConnection();
....
....
db.Open(); // Compiler Error CS0117