Hello,
One of the possible problems when programming is passing a handle to the wrong thing to a function/procedure/method and the compiler is unable to catch this error because, as of now, most handles are assignment compatible with one another.
For instance, in Windows, an HWND can be assigned to an HMENU which can be assigned to an HPALETTE which can be assigned to an HBITMAP and so on. This is because these types are not real types independent of each other but, synonyms of their underlying type (which is usually the same for most, if not all, handles.)
The request is simple: provide a way to declare types that even though may share the same underlying type are NOT assignment compatible with one another. IOW, provide a simple and effective way to ensure an HWND cannot be assigned to an HBITMAP or anything else that is not an HWND (however, still allow typecasting.)
This would help prevent bugs and would set FPC apart. It is a very, very simple feature but, it would really be a very nice feature to have.
I believe I have requested this feature in the past, I also believe I am not the only one to request it (using other words but, same concept.) I believe the feature is important enough that it should be requested again.
Maybe if enough people support the addition of this feature, it might eventually make it into the compiler (of course, the sooner, the better.)
Comments welcome.
ETA:
Added poll