mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-20 07:50:45 +00:00
f025bd96d4
Copying methods is done when adding protocols to classes (the current use for adding regular methods is an incorrect solution to a different problem). However, when a method is added to a class, the type of its self parameter is set to be a pointer to the class. Thus, not only does the method need to be copied, the self parameter does too, otherwise the self parameter of methods added via protocols will have their type set to be a pointer to the last class seen adding the protocol. That is, if, while compiling the implementation for class A, but the interface for class B is comes after the interface for class A, and both A and B add protocol P, then all methods in protocol P will have self pointing to B rather than A. @protocol P -method; @end @interface A <P> @end @interface B <P> @end @implementation A -method {} // self is B, not A! @end |
||
---|---|---|
.. | ||
doc | ||
include | ||
source | ||
test | ||
AUTHORS | ||
bootstrap | ||
configure.in | ||
Makefile.am | ||
TODO |