8036986: Test should check that correctly type is returned running with optimistic. If optimistic assumption was wrong we should get the right one

This uses the inspection framework for generated code to ensure optimisim.

Reviewed-by: attila, lagergren
3 files changed