hhvm / hacklang.org

The content for hacklang.org
http://hacklang.org
Creative Commons Attribution 4.0 International
21 stars 20 forks source link

Adds information about <<Override>> in exercise 23 #5

Closed AndrewSB closed 6 years ago

AndrewSB commented 6 years ago

I'm not sure if this is right, the reason I'm submitting this is partially because I want to know what happens (without trying to compile something myself), and also because I feel as though I'm not the only person who wonders what happens if <<Override>> is omitted at this point in the tutorial.

If my understanding of <<Override>> being omitted is incorrect, can someone please correct me? I'd be more than happy to update this commit

JoelMarcey commented 6 years ago

cc @fredemmott

fredemmott commented 6 years ago

Heh, the existing content is wrong: the attribtue is <<__Override>> - the __ is important.

That said - this change is also incorrect - Hack itself does not require the presence of <<__Override>>. If you want that behavior, you need to use a linter such as https://github.com/hhvm/hhast - Facebook's www repository has a similar linter with a rule that enforces this, which is probably why you're seeing this - it's not coming from HHVM or the typechecker.

AndrewSB commented 6 years ago

Ahh, I see. Thanks for clearing that up @fredemmott 🙃