mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 09:09:30 +02:00
* Class(classref) should not be allowed
This commit is contained in:
parent
d79fd9f918
commit
2e4fdfd4ec
25
tests/tbf/tb0151.pp
Normal file
25
tests/tbf/tb0151.pp
Normal file
@ -0,0 +1,25 @@
|
||||
{ %fail }
|
||||
|
||||
{$ifdef fpc}{$mode objfpc}{$endif}
|
||||
|
||||
type
|
||||
TStream = class(TObject)
|
||||
function Seek(offset:Int64):Int64;
|
||||
end;
|
||||
|
||||
TSeek64 = function(offset:Int64):Int64 of object;
|
||||
|
||||
function TStream.Seek(offset:Int64):Int64;
|
||||
begin
|
||||
end;
|
||||
|
||||
var
|
||||
s : TStream;
|
||||
p : TSeek64;
|
||||
c : TClass;
|
||||
begin
|
||||
s:=TStream.Create;
|
||||
c:=s.Classtype;
|
||||
{ This is not valid, @c should be used }
|
||||
p:=@TStream(c).Seek;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user