Jump to content
Rustam Novikov

inline var and type deduction with Currency type

Recommended Posts

I have a following simple code:

          var x: Currency;
          var y := x;

Can anyone explain why variable y type is Extended and not Currency?

My expectation is that type deduction should deduce Currency type from x variable type. 

This erroneous type deduction leads to problems when later I want to compare variable y to some other variable, say z: Currency:

if (x<>z) then raise...

Is it "by design" or some compiler issue?  

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×