                              In the

    United States Court of Appeals
                For the Seventh Circuit
                    ____________________
No. 19-1168
ANDREW L. JACKSON,
                                               Petitioner-Appellant,
                                v.

BYRAN BARTOW,
                                              Respondent-Appellee.
                    ____________________

        Appeal from the United States District Court for the
                  Eastern District of Wisconsin.
         No. 17-CV-17 —Nancy Joseph, Magistrate Judge.
                    ____________________

      SUBMITTED JULY 9, 2019 — DECIDED JULY 23, 2019
                 ____________________

   Before KANNE, HAMILTON, and SCUDDER, Circuit Judges.

    PER CURIAM. A Wisconsin trial court denied Andrew L.
Jackson’s request to represent himself at trial, and Jackson
later pleaded guilty. He seeks a writ of habeas corpus under
28 U.S.C. § 2554, arguing that Wisconsin unreasonably ap-
plied Supreme Court precedent involving the Sixth
Amendment right for competent defendants to represent
themselves at trial. The district court agreed with Jackson
2                                                 No. 19-1168

that the Wisconsin trial court erred in ruling that he could
not represent himself at trial, but it nonetheless denied his
petition. It correctly concluded that under Gomez v. Berge,
434 F.3d 940 (7th Cir. 2006), Jackson waived his right to chal-
lenge that earlier ruling when he later entered an uncondi-
tional, knowing, and voluntary guilty plea. Therefore, we
affirm.
                        I. BACKGROUND
    Jackson faced serious charges in Wisconsin state court,
and the court appointed a lawyer for him. Prosecutors ac-
cused him of throwing boiling oil at his wife, knifing her in
front of their children, and later, threatening her from pris-
on. At a hearing in January 2012, Jackson asked the judge to
remove his counsel. He complained that counsel had with-
held discovery and met with him too late in the proceedings
to adequately discuss strategy. The court granted the mo-
tion. At the same time, the court barred Jackson from com-
municating with anyone but his attorney of record because
of his threatening phone calls to his wife.
    After the court appointed another lawyer, that lawyer
reported that Jackson also asked him to withdraw. Jackson
complained that he had not yet received some discovery ma-
terials and that counsel had no faith in him. The court ruled
that these reasons were inadequate and refused to appoint a
third lawyer. The judge allowed Jackson to seek a private
attorney so long as he adhered to the restrictions on his out-
side communications.
   Jackson told the trial judge that he wanted to represent
himself, but the judge denied that request. He said that he
would consider Jackson’s request only if Jackson was “capa-
No. 19-1168                                                    3

ble of and ready and prepared” to represent himself, but it
was “not a given [he] could do it.” Months later, the court
returned to Jackson’s request. It stressed the complexity of
the case, explaining that it would not trust someone with
under five years of defense experience to represent Jackson
and warning that Jackson “can’t do this.” Jackson still insist-
ed that he could. The court ultimately denied Jackson’s re-
quest. It reasoned that Jackson was “clearly incompetent …
to present a case of this complexity” and lacked “the abil-
ity[…], the training, the knowledge, and the time to properly
prepare it.”
    Jackson pleaded guilty a few days later to two counts of
felony intimidation of a witness, one count of first-degree
reckless injury, and one count of aggravated battery. He re-
ceived a prison sentence of 20 years. Jackson filed a post-
conviction petition in Wisconsin, seeking to withdraw his
guilty plea on the ground that he was denied his right to
self-representation at trial. The post-conviction court denied
his motion. Jackson appealed, but the Wisconsin Court of
Appeals affirmed, reasoning that Jackson “did not sufficient-
ly understand the complexity of his trial or the law concern-
ing the charges against him.” He petitioned the Wisconsin
Supreme Court, but it denied review.
    Jackson’s next step was a federal petition for a writ of ha-
beas corpus. In it, he argues that Wisconsin unreasonably
applied Supreme Court precedent by affirming the denial of
his request to represent himself at trial. (He does not claim
that he had a right to self-representation at his guilty plea, or
that, because unwanted counsel represented him at his
guilty plea, his plea was not knowing and voluntary.) He
4                                                 No. 19-1168

stresses that, because he was competent to plead guilty, he
was competent to represent himself at trial.
    Presiding by consent, a magistrate judge denied the peti-
tion. She explained that, even though the Wisconsin appeals
court had unreasonably applied Supreme Court precedent
on the Sixth Amendment right to self-representation at trial,
Jackson waived the error by validly pleading guilty. Under
Gomez v. Berge, 434 F.3d 940 (7th Cir. 2006), his valid guilty
plea waived any defects in the proceedings before the plea,
including any Sixth Amendment violation.
                        II. ANALYSIS
    The Antiterrorism and Effective Death Penalty Act gov-
erns our review of Jackson’s petition. As relevant here, the
Act allows habeas relief only if the decision of the Wisconsin
Court of Appeals, the last state court to address Jackson’s
claim, was “contrary to, or involved an unreasonable appli-
cation of, clearly established Federal law, as determined by
the Supreme Court of the United States.” 28 U.S.C.
§ 2254(d)(1). Echoing the district court, Jackson argues that,
by refusing to let him represent himself at trial, the Wiscon-
sin Court of Appeals unreasonably applied Faretta v. Califor-
nia, 422 U.S. 806 (1975). In Faretta, the Supreme Court held
that under the Sixth Amendment, defendants have the right
to represent themselves at trial so long as they competently
choose to do so. 422 U.S. at 807.
   Jackson is correct: the Wisconsin Court of Appeals unrea-
sonably applied Faretta when it affirmed the trial court. The
appellate court based its decision solely on Jackson’s
knowledge deficits (he did not know “the law” or the trial’s
“complexity”), not mental health problems (which he did
No. 19-1168                                                    5

not have). By relying on Jackson’s lack of skill, the appellate
court’s decision was contrary to and an unreasonable appli-
cation of Faretta. As we recently explained in Tatum v. Foster,
       Faretta protects the right of a criminal defend-
       ant to make this (usually) self-defeating choice
       [of self-representation]. By failing to recognize
       that the Supreme Court's Faretta line of cases
       focus only on competence as it relates to men-
       tal functioning, and forbids the consideration
       of competence in the sense of accomplishment,
       the Wisconsin courts reached a result that is
       contrary to, as well as an unreasonable applica-
       tion of, the Supreme Court's rulings.
847 F.3d 459, 469 (7th Cir. 2017).
    This error, however, does not entitle Jackson to relief if he
validly waived his right to contest it. See Ward v. Hinsley, 377
F.3d 719, 725–26 (7th Cir. 2004). The magistrate judge ruled,
and the state maintains on appeal, that Jackson’s guilty plea
waives his claim of any error. Jackson offers two responses,
but neither is persuasive.
   Jackson’s first response is that the State may not assert
waiver because it did not raise waiver as an affirmative de-
fense in its answer to Jackson’s federal petition. See FED. R.
CIV. P. 8(c). But the district court and this court may raise
Jackson’s waiver sua sponte, as Jackson admits. See, e.g.,
Gomez, 434 F.3d at 942; Gomez v. Berge, 2004 WL 1852978, at
*2 (W.D. Wis. Aug. 18, 2004). And the district court gave
Jackson an opportunity to address the defense, so he has not
been prejudiced by its omission from the answer. The de-
fense is thus properly before this court.
6                                                  No. 19-1168

    Jackson’s second argument is equally unavailing. He con-
tends that the district court improperly relied on Gomez to
rule that he waived any error. Gomez held that “an uncondi-
tional plea of guilty operates as a waiver of all formal defects
in the proceedings, including any constitutional violations
that occurred before the plea was entered.” 434 F.3d at 942.
Gomez made a no-contest plea, and we ruled that this plea
precluded him from “contesting the trial court's determina-
tion that he was not competent to represent himself at trial.”
Id. at 943. We have reiterated Gomez several times in recent
years. See, e.g., United States v. Lockett, 859 F.3d 425, 427
(7th Cir. 2017); United States v. Stoller, 827 F.3d 591, 594
(7th Cir. 2016); Hurlow v. United States, 726 F.3d 958, 966
(7th Cir. 2013).
    Jackson’s case is identical to Gomez. Both Gomez and
Jackson were indicted in Wisconsin state court; both were
denied the right to self-representation at trial; both later en-
tered pleas in lieu of going to trial (Gomez pleaded no con-
test, and Jackson pleaded guilty); and both petitioned for a
federal writ of habeas corpus based on the denial of the right
to self-representation. But because their pleas waived any
claim about pre-plea errors, neither received federal relief.
Under Gomez, Jackson must lose.
   To avoid this result, Jackson argues that United States v.
Smith, 618 F.3d 657 (7th Cir. 2010), supersedes Gomez. Smith
was a direct appeal. It vacated a guilty plea that a defendant
entered after the district court refused to allow him to re-
place one attorney with another. According to Jackson, Smith
applied a new rule: an unconstitutional denial of a defend-
ant’s choice of counsel is a “structural error” that “brings in-
to question the voluntary and intelligent character of the
No. 19-1168                                                    7

guilty plea itself.” 618 F.3d at 663 (quotations omitted). Jack-
son contends that, under Smith, his denial of
self-representation is also a structural error that similarly
overcomes the defense that he waived it by pleading guilty.
Jackson’s argument fails, and Gomez controls, for three rea-
sons.
    First, Jackson incorrectly asserts that Smith espoused a
new rule about structural errors in the context of self-
representation. It is true that in Smith this court observed
that in United States v. Gonzalez-Lopez, 548 U.S. 140 (2006), the
Supreme Court held for the first time that the denial of a de-
fendant’s choice of counsel is structural and not subject to
harmless-error review. Smith, 618 F.3d at 663 (citing Gonza-
lez-Lopez, 548 U.S. at 148). But Gonzalez-Lopez also noted that
the wrongful denial of the right to self-representation at trial
has been considered a structural defect since at least 1984.
548 U.S. at 149. (“[Structural] errors include … the denial of
the right of self-representation … .”) (citing McKaskle v. Wig-
gins, 465 U.S. 168, 177–78, n.8 (1984)). So, when this court de-
cided Gomez in 2006, it knew that the erroneous denial of
self-representation at trial was a structural defect—yet it en-
forced the guilty-plea-waiver rule anyway. Thus, Smith did
not create a new rule about self-representation that super-
sedes Gomez.
    Second, the consequence of a “structural” error is that it
is not subject to harmless-error review, see Gonzalez-Lopez,
548 U.S. at 148; but such errors can still be waived. Doctrines
of default and waiver are grounded in federalism and comi-
ty, so they apply on federal habeas review even if the “claim
raised before the federal habeas court is one of structural er-
ror.” Ward, 377 F.3d at 725–26; United States v. Gaya, 647 F.3d
8                                                   No. 19-1168

634, 640 (7th Cir. 2011) (explaining that “there is no reason to
exempt ‘structural errors’” from waiver). Nothing in Gonza-
lez-Lopez or Smith suggests that a defendant like Jackson
cannot knowingly and voluntarily waive his claim of a prior
structural error by validly pleading guilty.
     Third, Smith is consistent with Gomez. Smith vacated the
defendant’s guilty plea because we decided that the denial
of his counsel of choice at trial called into question his plea’s
voluntariness. See 618 F.3d at 663, 667. Here, Jackson does
not claim in his petition in the district court (nor does he ar-
gue in this court) that, because the trial court would not let
him represent himself at trial, his counseled guilty plea was
unknowing or involuntary. To the contrary, Jackson’s peti-
tion appears to imply that his guilty plea was valid—he ar-
gues that he was competent to represent himself at trial pre-
cisely because he was “competent” to plead guilty. By not
raising that claim in the district court, Jackson did not devel-
op an argument or record on the voluntariness of his plea,
and the district court had no chance to assess the argument
or the State’s responses to it. Therefore, Jackson has forfeited
that claim for review in this court. Frazier v. Varga, 843 F.3d
258, 262 (7th Cir. 2016). (“Regardless of whether a habeas
claim was fairly presented or defaulted in the state courts, if
an argument was not presented to the federal district court,
it is forfeited in this court.”) Without a preserved claim that
his guilty plea was unknowing or involuntary, Smith is in-
apposite and Gomez demonstrates that Jackson’s plea waived
any prior errors in the state trial court.

                                                    AFFIRMED
