Can the zero set of an irreducible polynomial contain a non-empty Zariski open subset?

If $U \subseteq \mathbf{A}^{n}$ is nonempty and open, then $\text{dim }U=\text{dim }\overline{U}=\text{dim }\mathbf{A}^{n}=n$.
Now if $U \subseteq Z(f)$, then $\text{dim }U \leq \text{dim }Z(f) = n-1$, which is impossible.

Here are the relevant facts used from Ch. 1, Sec. 1 in Hartshorne (valid over any algebraically closed field):
$\bullet$ The dimension of a quasi-affine variety is the same as its closure (Proposition 1.10)
$\bullet$ $\mathbf{A}^{n}$ is irreducible (its ideal is prime: $I(\mathbf{A^{n}})=0$), and a nonempty open subset of an irreducible space is dense (Exercise 1.6)
$\bullet$ The dimension of $\mathbf{A}^{n}$ is $n$ (Proposition 1.9)
$\bullet$ If $Y \subseteq X$ are topological spaces, then $\text{dim }Y \leq \text{dim }X$ (Exercise 1.10a)
$\bullet$ $Z(f)$ has dimension $n-1$ (Proposition 1.13)



Suppose that $Z(f)$ contains the open subset $U$, the complementary $C$ of $U$ is closed and is $V(I)$ this implies that $Z(f)\cup V(I)=V(fI)$ is the whole space the theorem of zero implies that $If=0$ contradiction