Type Inference

From RemObjects Software

Jump to: navigation, search

This is a Oxygene Language Feature topic
Feel free to add your notes to this topic below.



Variable Type Inference allows you to declare local variables without having to specify the type, provided that the type can be determined from the context.

For example,

var x := new SomeTypeName(...);

replaces

var x : SomeTypeName := new SomeTypeName(...);

Scope

Variable Type Inference applies to simple types as well, e.g.

var x := 3;
  var s := 'Hello';

The assignment will be to the lowest type possible, e.g. integer rather than longint.

Only local and inline variables are supported currently.


See Also


Product: RemObjects Oxygene (formerly known as Chrome)
Current version: 3.0 Previous Versions: 'Joyride' (2.0), 'Floorshow' (1.5), 'Adrenochrome' (1.0)

GlossaryKeywordsLanguage FeaturesPlatform FeaturesSamplesArticlesHow ToIssues

Personal tools