Show/Hide Toolbars

XSharp

All elements of a string concatenation must be of type 'string'. Element {0} is of type '{1}'

Previous version of the X# compiler (just like C#) allowed you to do a string concatenation of non string values. This has been disabled now.

 

FUNCTION Start as VOID
  LOCAL sName as STRING
  LOCAL iAge as LONG
  sName := "John Doe"
  iAge := 42
  ? sName + iAge // error XS9078: All elements of a string concatenation must be of type 'string'. Element 2 is of type 'int'
  Console.ReadLine()
  RETURN