Type Inference

From The Oxygene Language Wiki
Jump to: navigation, search

This is a Language topic about Oxygene
 

Language Topics Introduction | Structured Overview | Grammar | Keywords | Functions



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

Personal tools
Namespaces

Variants
Actions
Navigation
Getting Started
Sections
If you know
More
Toolbox