View Issue Details

IDProjectCategoryView StatusLast Update
0033016FPCDocumentationpublic2018-02-24 18:01
ReporterEwaldAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Product Version3.1.1Product BuildSVN rev. 30487 
Target Version3.2.0Fixed in Version3.1.1 
Summary0033016: String message methods and the self parameter
DescriptionWhen reading https://www.freepascal.org/docs-html/ref/refsu31.html#x82-1040006.5.7 I stumbled on the following text at the bottom of the page:

"In addition to this mechanism, a string message method accepts a self parameter:
Procedure StrMsgHandler(Data: Pointer;
                        Self: TMyObject); Message ’OnClick’;

When encountering such a method, the compiler will generate code that loads the Self parameter into the object instance pointer. The result of this is that it is possible to pass Self as a parameter to such a method.

Remark: The type of the Self parameter must be of the same class as the class the method is defined in."

I observe that the above code snippet fails to compile with the message "Message handlers can take only one call by ref. parameter"

When asked on the mailing list, this seems to be a documentation issue:
"Judging from the implementation inside the RTL I'd say that this is a bug in the documentation. String message methods work like ordinal ones and take only one parameter."
TagsNo tags attached.
Fixed in Revision1468
FPCOldBugId
FPCTarget
Attached Files

Activities

Michael Van Canneyt

2018-01-13 19:04

administrator   ~0105749

In that case someone broke the compiler.

The above was introduced to handle GTK message pasing methods.

I will ask the compiler people.

Michael Van Canneyt

2018-02-24 18:01

administrator   ~0106585

I removed this information, apparently this was removed a long time from the compiler.

Issue History

Date Modified Username Field Change
2018-01-13 18:27 Ewald New Issue
2018-01-13 18:27 Ewald Status new => assigned
2018-01-13 18:27 Ewald Assigned To => Michael Van Canneyt
2018-01-13 19:04 Michael Van Canneyt Note Added: 0105749
2018-02-24 18:01 Michael Van Canneyt Fixed in Revision => 1468
2018-02-24 18:01 Michael Van Canneyt Note Added: 0106585
2018-02-24 18:01 Michael Van Canneyt Status assigned => resolved
2018-02-24 18:01 Michael Van Canneyt Fixed in Version => 3.1.1
2018-02-24 18:01 Michael Van Canneyt Resolution open => fixed
2018-02-24 18:01 Michael Van Canneyt Target Version => 3.2.0