> You aren’t prohibited under the license, but you are prohibited under the contract you agreed to, to get that code.
This doesn't make sense to me. MIT is a license to share and modify code. If another license can supersede that and remove rights granted by the actual license, then what prevents any company from releasing their code under MIT and then adding a shrinkwrap EULA that prevents looking at the code or modifying it? The license wouldn't mean anything.
> imagine a company hired you to write a library they want to later release as GPL. They still might have rules that you can’t release that library except under certain conditions.
Before it's released as GPL, sure. But once it's actually released as GPL, that company can't prevent you from looking at the code or modifying it or redistributing it. At best, they can sever their relationship with you over doing so, but they can't legally challenge you doing so.
If that wasn't the case, nothing would prevent a company from taking 3rd-party GPL code, building on top of it, releasing the product as GPL, but then adding additional contractual requirements to get access to their product that prevented anyone from looking at or sharing that code. The GPL wouldn't have any power or enforceability.
Companies do circumvent the GPL a lot and they get called out on it when they don't allow customers to get copies of the source code or to share it online. I've never heard anyone seriously suggest that a valid defense would be for them to say, "okay, yes we're using GPL code but to buy the product you have to sign a contract and that contract legally prevents you from sharing the code." Those restrictions would themselves be a GPL violation.