View Issue Details

IDProjectCategoryView StatusLast Update
0035354FPCDocumentationpublic2019-04-10 11:01
ReporterAkira1364Assigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSWindowsOS Version10
Product Version3.3.1Product Build41854 
Target Version3.2.0Fixed in Version3.3.1 
Summary0035354: [Patch] Minor addition to the recently added enumerator section in the reference manual, plus a couple of other tweaks.
DescriptionThis patch mostly makes it clearer that enumerators can be classes, objects, or advanced records, not just classes. It also adds a note about the enumerator operator not being valid in {$mode Delphi}, and corrects a misspelling of the word "enumerable".
TagsNo tags attached.
Fixed in Revision1597
FPCOldBugId
FPCTarget
Attached Files
  • ref.tex.patch (1,783 bytes)
    Index: ref.tex
    ===================================================================
    --- ref.tex	(revision 1596)
    +++ ref.tex	(working copy)
    @@ -9505,14 +9505,14 @@
     \item An array value. The loop will be over all elements in the array, and
     the control variable must have the same type as an element in the array.
     As a special case, a string is regarded as an array of characters.
    -\item An enumeratable class instance. This is an instance of a class that
    -supports the \var{IEnumerator} and \var{IEnumerable} interfaces. 
    +\item An enumerable class, object, or extended record instance. This is an instance of any
    +structured type that supports the \var{IEnumerator} and \var{IEnumerable} interfaces. 
     In this case, the control variable's type must equal the type of the 
     \var{IEnumerator.GetCurrent} return value.
     \item Any type for which an \var{enumerator} operator is defined. The
    -\var{enumerator} operator must return a class that implements the
    +\var{enumerator} operator must return a structured type that implements the
     \var{IEnumerator} interface. The type of the control variable's type 
    -must equal the type of the enumerator class \var{GetCurrent} return 
    +must equal the type of the enumerator's \var{GetCurrent} return 
     value type.
     \end{enumerate}
     
    @@ -12045,7 +12045,8 @@
     
     \section{The enumerator operator}
     The enumerator operator can be used to define an enumerator for any type. 
    -It must return a class that has the same signature as the IEnumerator interface.
    +It must return a class, object, or extended record that has the same signature as the IEnumerator interface.
    +Note that this operator is not recognized by the compiler under the Delphi syntax mode.
     
     The following code will define an enumerator for the Integer type:
     \begin{verbatim}
    
    ref.tex.patch (1,783 bytes)

Activities

Akira1364

2019-04-10 01:43

reporter  

ref.tex.patch (1,783 bytes)
Index: ref.tex
===================================================================
--- ref.tex	(revision 1596)
+++ ref.tex	(working copy)
@@ -9505,14 +9505,14 @@
 \item An array value. The loop will be over all elements in the array, and
 the control variable must have the same type as an element in the array.
 As a special case, a string is regarded as an array of characters.
-\item An enumeratable class instance. This is an instance of a class that
-supports the \var{IEnumerator} and \var{IEnumerable} interfaces. 
+\item An enumerable class, object, or extended record instance. This is an instance of any
+structured type that supports the \var{IEnumerator} and \var{IEnumerable} interfaces. 
 In this case, the control variable's type must equal the type of the 
 \var{IEnumerator.GetCurrent} return value.
 \item Any type for which an \var{enumerator} operator is defined. The
-\var{enumerator} operator must return a class that implements the
+\var{enumerator} operator must return a structured type that implements the
 \var{IEnumerator} interface. The type of the control variable's type 
-must equal the type of the enumerator class \var{GetCurrent} return 
+must equal the type of the enumerator's \var{GetCurrent} return 
 value type.
 \end{enumerate}
 
@@ -12045,7 +12045,8 @@
 
 \section{The enumerator operator}
 The enumerator operator can be used to define an enumerator for any type. 
-It must return a class that has the same signature as the IEnumerator interface.
+It must return a class, object, or extended record that has the same signature as the IEnumerator interface.
+Note that this operator is not recognized by the compiler under the Delphi syntax mode.
 
 The following code will define an enumerator for the Integer type:
 \begin{verbatim}
ref.tex.patch (1,783 bytes)

Michael Van Canneyt

2019-04-10 11:01

administrator   ~0115384

Applied. Thank you, indeed a necessary correction !

Issue History

Date Modified Username Field Change
2019-04-10 01:43 Akira1364 New Issue
2019-04-10 01:43 Akira1364 Status new => assigned
2019-04-10 01:43 Akira1364 Assigned To => Michael Van Canneyt
2019-04-10 01:43 Akira1364 File Added: ref.tex.patch
2019-04-10 11:01 Michael Van Canneyt Fixed in Revision => 1597
2019-04-10 11:01 Michael Van Canneyt Note Added: 0115384
2019-04-10 11:01 Michael Van Canneyt Status assigned => resolved
2019-04-10 11:01 Michael Van Canneyt Fixed in Version => 3.3.1
2019-04-10 11:01 Michael Van Canneyt Resolution open => fixed
2019-04-10 11:01 Michael Van Canneyt Target Version => 3.2.0