modern-pascal/modern-pascal-introduction

Invalid C3 class

Closed this issue · 2 comments

In https://github.com/eugeneloza/modern-pascal-introduction/blob/master/code-samples/interfaces_corba_test.lpr TMyClass3 doesn't refer to the interface and therefore will cause an error, right? This "feature" is described in two sequential examples, but in the first example it looks unexpected.

The condition C3 is IMyInterface will be false, in the if C3 is IMyInterface then ... . So it will not cause an error, the line UseThroughInterface(C3 as IMyInterface) simply will not be executed.

I'll mark it in the code, to make it clear. Thank you!

I updated the example code:)