Retirement tax questions

As I turn 65 this July, I come under Medicare coverage this July 1, which I take to mean July 1 is my effective date.  Is that incorrect?  I'm not eligible to apply, i.e. register into their system, until April 1, and I plan to apply that month -- but as I understand it, that will not be the effective date, July 1 is, and I won't be covered by Medicare until July 1 whether I apply on April 1 or June 30.  I intend to make my last allowed contribution to the HSA this month (I have plenty of medical bills to pay right now), which is before I can even apply for Medicare, regardless of the Medicare effective date. If the IRS is likely to impose a penalty because I contributed to my HSA four months before my Medicare coverage starts and over a month before I can apply, but within Medicare's six-month lookback, please explain, because it's exactly the question I raised.  Otherwise, I understood you as saying earlier that the lookback won't come into force if I apply before July 1, and as it happens I'll have already contributed my maximum before that.