File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 6565 MyInterface := TMyClass2.Create(nil );
6666 MyClass := TMyClass2.Create(nil );
6767
68- // This doesn't compile, since at compile-time it's unknown if My is IMyInterface2.
69- // UseInterface2(My );
68+ // This doesn't compile, since at compile-time it's unknown if MyInterface is IMyInterface2.
69+ // UseInterface2(MyInterface );
7070 // UseInterface2(MyClass);
7171
7272 // This compiles and works OK.
@@ -80,12 +80,12 @@ begin
8080 UseInterface2(MyClass as IMyInterface2);
8181
8282 // This compiles, but will fail at runtime, with ugly "Access violation".
83- // UseInterface3(IMyInterface3(My ));
83+ // UseInterface3(IMyInterface3(MyInterface ));
8484 // This does not compile. Casting InterfaceType(ClassType) is checked at compile-time.
8585 // UseInterface3(IMyInterface3(MyClass));
8686
8787 // This compiles, but will fail at runtime, with nice "EInvalidCast: Invalid type cast".
88- // UseInterface3(My as IMyInterface3);
88+ // UseInterface3(MyInterface as IMyInterface3);
8989 // This compiles, but will fail at runtime, with nice "EInvalidCast: Invalid type cast".
9090 // UseInterface3(MyClass as IMyInterface3);
9191
You can’t perform that action at this time.
0 commit comments