HaxeFoundation / haxe.org-comments

Repository to collect comments of our haxe.org websites
2 stars 2 forks source link

[haxe.org/manual] Inline (Class Fields - Access Modifier) #141

Open utterances-bot opened 6 months ago

utterances-bot commented 6 months ago

Inline (Class Fields - Access Modifier) - Haxe - The Cross-platform Toolkit

Haxe is an open source toolkit based on a modern, high level, strictly typed programming language.

https://haxe.org/manual/class-field-inline.html

ea7ababe commented 6 months ago

The compiler might cancel inlining for various reasons or a user could supply the --no-inline command line argument to disable inlining. The only exception is if the class is extern or if the class field has the extern access modifier, in which case inline is forced.

This paragraph (and the example below it) seem to conflict with this quote from the Externs page:

Externs can be used to describe target-specific interaction in a type-safe manner. They are defined like normal classes, except that

  • ...
  • methods have no expressions,
  • ...

So, the Externs page suggests that extern methods cannot have expressions, while the Inline page suggests that they can.