Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Generics    [ Add a report in this area ]  
Report #:  120901   Status: Closed
operator overload for LogicalNot does not compile
Project:  Delphi Build #:  XE, ... XE5
Version:    19.0 Submitted By:   Stefan Glienke
Report Type:  Basic functionality failure Date Reported:  12/2/2013 4:22:15 AM
Severity:    Infrequently encountered problem Last Updated: 4/15/2014 6:35:33 PM
Platform:    All platforms Internal Tracking #:   45683
Resolution: Fixed (Resolution Comments) Resolved in Build: : XE6
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 10
Description
operator overload for LogicalNot does not compile

see steps
Steps to Reproduce:
---------
program Project1;

type
  TSpec<T> = record
    class operator LogicalNot(const spec: TSpec<T>): TSpec<T>;
  end;

class operator TSpec<T>.LogicalNot(const spec: TSpec<T>): TSpec<T>;
begin
end;

function SomeSpec: TSpec<Integer>;
begin
end;

var
  s: TSpec<Integer>;
begin
  s := SomeSpec;      // compiles
  s := not s;         // compiles
  s := not SomeSpec();  // does not compile - E2015 Operator not applicable to this operand type
end.
---------
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01