@@ -0,0 +1,29 @@
+{ %fail }
+
+{$mode delphi}
+type
+ texec1 = class
+ protected
+ procedure execute;
+ public
+ constructor create;
+ end;
+ procedure t(p: pointer);
+ begin
+ constructor texec1.Create;
+ // This should give an invalid typecast, because a methodpointer are 2 pointers
+ t(pointer(execute));
+ procedure texec1.execute;
+begin
+end.
@@ -1,29 +0,0 @@
-program bug3395;
-
-{$MODE DELPHI}
-{$THREADING ON}
-type
- texec1 = class
- protected
- procedure execute;
- public
- constructor create;
- end;
- procedure t(p: pointer);
- begin
- constructor texec1.Create;
- t(@execute);
- procedure texec1.execute;
-begin
-end.