When a public state variable overrides an external functions, it doesn't seem to check that the overriden function is marked "virtual" (while if we override with a function, then the overriden function MUST be marked "virtual").
The following typechecks without error nor warnings:
contract C1 {
function f() external pure returns(int) { return 42; }
}
contract C is C1 {
int override f;
}
It should report something like "Trying to override non-virtual function."
Note that in the example, C.f is not public, and thus cannot even override anything.
The actual solution here is to disallow override for state variables that aren't public, right?
Sounds like a plan!