| Online Eiffel Documentation

EiffelStudio

# Major changes between ISE Eiffel 5.5 and ISE Eiffel 5.6

## What's new

See also: Differences between standard ECMA-367 and Eiffel Software implementation

- Implemented once manifest strings. They can be used at the same places where normal manifest strings can be used, e.g.:

      s := once "abc"
      io.put_string (once "Hello World!")

  Once manifest strings are not created every time they are accessed. Instead one instance is created at the first access and then it is reused for subsequent accesses. In multithreaded application one instance is created for one thread.
- Supported aligned and non-aligned verbatim strings. Aligned verbatim strings use characters [ and ] in opening and closing sequence respectively, non-aligned verbatim strings use { and }.
- Added support for manifest type expression "{MY_TYPE}" which gives an instance of TYPE [MY_TYPE].
- New syntax for manifest constants. Now they can be preceeded by a manifest type expression. For example 1 is of type INTEGER, whereas {INTEGER_8} 1 is of type INTEGER_8.
- Support for NATURAL_XX types which are unsigned integers.
- Supported new feature alias syntax to specify operator and bracket names:

      negate alias "-": like Current ...
      multiply alias "*" (other: like Current): like Current ...
      item alias "[]" (index: INTEGER): G ...

  The first two declarations can be used similar to features prefix "-" and infix "*". The last one can be used to make feature calls with bracket expressions like

      letter  := letters [i]

  Operator and bracket aliases can also be used in rename subclause to change an alias name associated with a feature.
- Supported new feature assigner syntax to associate feature with an assigner command:

      item  alias "[]" (index: INTEGER): G assign put ...
      put (value: G; index: INTEGER) ...

  Given the declaration above the following instructions become equivalent:

      x.put (x.item (i + 1), i)
      x.item (i) := x.item (i + 1)
      x [i] := x [i + 1]

## Improvements

- Optimized .NET code generated for inspect instruction.
- Optimized access to process-relative once routines to avoid heavy-weight synchronization primitives when possible.
- Speed-up access to once routines in finalized multi-threaded applications.
- Improved some error messages to be more precise.
- Removed the requirement to freeze code that declares process-relative once routine.
- Improved multi-threaded application performance in classic mode by using built-in support for thread-local storage provided by some C compilers.
- Allowed underscores in hexadecimal literals.
- Provided syntax highlighting for hexadecimal literals in editor.
- Slightly improved reporting of syntax errors.
- Made keyword operator names clickable in flat view.

## Changes

- Void does not conform to expanded types. As a consequence, assignments of Void to expanded entities will be rejected rather than throwing an exception at run-time. And comparison of expanded entities to Void will cause a VWEQ validity error.
- Changed default behavior of once routines in .NET mode from once-per-process to once-per-thread to match behavior in classic mode.
- Provided project options (old_verbatim_strings and old_verbatim_strings_warning) to support semantics of verbatim strings as in previous versions when they were not left-aligned.
- Changed processing of hexadecimal integer literals to be consistent for different integer types. For example, 0xFF gives 255 when assigned to a variable of type INTEGER rather than -1 as before.
- Due to the new {} syntax, a few older syntax constructs have been removed:
  - "{X} Precursor (..)" is rejected and should be replaced by "Precursor {X} (...)".
  - "agent f (?, {A})" is now rejected, as it would conflict with a manifest type expression, instead you should write "agent f (?, {A} ?)".
- In .NET, all usage of INTEGER_8 from .NET libraries have been changed to NATURAL_8.
- In .NET, renamed TYPE, ATTRIBUTE_ and VOID_ from the mscorlib assembly into SYSTEM_TYPE, SYSTEM_ATTRIBUTE and SYSTEM_VOID.
- Changed exception handling for once routines so that exception raised during the first call is raised during any subsequent call to this routine.
- Introduced upper limit for value of integer constant used in BIT type declaration and extended VTBT rule to cover this change.
- To evaluate the type of a manifest array we now use the first item of the manifest array instead of the last one as a first guessed type.
- Allowed for integer literals with intermediate underscores at arbitrary positions.
- To ensure same behavior on various platforms, the standard output is now unbuffered (it previously was unbuffered on Windows and line buffered on Unix platforms).

## Bug fixes

### Language issues

- Used '%N' as an end of line in verbatim strings regardless of the end of line sequence in source code.
- Fixed incorrect handling of negative hexadecimal integer literals when sign before the literal was not taken into account. For example, -0x1 could be interpreted as 1.
- Implemented checks for input ranges of integer constants and fixed issue with inability to assign minimum integer values to variables of the corresponding integer types.

  Type | Integer interval | Unsigned hexadecimal representation
  INTEGER_8 | -128 .. 127 | 0x0 .. 0xFF
  INTEGER_16 | -32768 .. 32767 | 0x0 .. 0xFFFF
  INTEGER_32 | -2147483648 .. 2147483647 | 0x0 .. 0xFFFFFFFF
  INTEGER_64 | -9223372036854775808 .. 9223372036854775807 | 0x0 .. 0xFFFFFFFFFFFFFFFF

- Excluded nonsignificant leading zeroes from determination of allowed integer constant type, so that 00000000000000123 is now a valid INTEGER_8 value.
- Shared the same data accross once routines and string constant attributes from different generic derivations of the same class. Added a warning for once routines that appear in a generic class to notify about this change in semantics.
- Correctly supported replication of once features when compiling for .NET.
- Changed order of evaluation of once routines to check precondition with class invariant even when once routine has already been called.
- Added a check that length of identifier, manifest string and free operator does not exceed a maximum value of 32767 bytes.

### Compiler issues

- Fixed crash of the compiler at the very end of a finalization of a system which has an assignment of a manifest type into a variable of type ARRAY [like anchor] where anchor is a feature being redefined with a different type in a descendant class.
- Fixed an issue where compiler would report more than once the same error in an incremental recompilation.
- Fixed issue where changing a normal routine to an external and having a compile error, and then reverting back to a normal routine while fixing the error would cause the compiler to crash.
- Fixed some cases where project could be corrupted after a recompilation.
- Now compiler reports VTCT errors at the end of degree 5, rather than during degree 5, so that you can collect all the VTCT errors at once.
- Thanks to the improvement in VTCT errors reporting, now compiler will not generate an incorrect VTCT errors during an incremental recompilation for a class which has actually been removed from the system.
- Supported recompilation of once routines when their status is changed from "process-relative" to "thread-relative" or back.
- Supported output of multi-line obsolete messages.
- Fixed a recompilation bug that resulted in incorrect (or even, in case of .NET, in invalid) generated code when incrementally finalizing a system without explicitly specified root creation procedure.
- Fixed a bug with resolving some generic-like types (i.e., types that are processed in a special way: tuple, native array, typed pointer) that depend on anchored types: before they were converted to "normal" generic types thus loosing their special properties.
- Fixed a bug that caused compiler to crash when finalizing a code that looks like

      if true then [else(if) ...] end

  i.e. has empty compound for a primary condition which is a constant true.
- Fixed a bug in processing configuration option precompiled that caused a compiler to crash when no option value was provided.
- Fixed a bug in incremental recompilation when multi-branch validity rules are violated in one class because constant attribute used in the multi-branch instruction is changed in another class, that declares them, into a non-constant feature.
- Fixed multiple bugs in feature basic text view that caused truncated or extraneous output.
- Fixed bug where if an actual generic parameter was an anchor, then if the type containing this actual was used for assignment attempt or for creation we would use an incorrect type for the actual generic. We were using the type of the anchor in the class were the code was written, instead of actually re-evaluating the type of the anchor for each descendant class.

### Runtime/code generation issues

- Fixed bug in deep_twin from ANY in .NET which would cause a call on Void target when applied on object of type STRING and possibly other types.
- Corrected C code on Windows for constants of type INTEGER_64. Before constants of this type between -2147483648 and -1 could be processed as positive 64-bit values.
- Fixed incorrect C and IL code generation for INTEGER_8 and INTEGER_16 arithmetic and shift operations that might produce incorrect result when combined in two or more operations in a row. For example,

      i := (i + i) |>> 1

  assigned -128 to i of type INTEGER_8 if the initial value of i was -128. Now this instruction assigns 0.
- Synchronized access to data of process-relative once routines to avoid race conditions when two or more threads simultaneously access the same once routine.
- Avoided permanent blocking of a thread accessing process-relative once routine when this routine is concurrently evaluated in some other thread and raises an exception.
- Fixed bugs in memory allocation in C code for result of a once function that returns basic type:
  - it might cause memory corruption when memory size required to store the result is greater than size of a pointer;
  - there was a memory leak.
- Fixed a bug in classic mode that caused last exception to be cleared after returning from a routine that has a rescue clause but returns normally.
- Fixed several bugs related to handling of nested exceptions in classic mode.
- Changed a limit of maximum class name length in melted byte code from 256 bytes to 32767 bytes.
- Changed C code generation for long strings (that result from long manifest strings, identifiers, etc.) to avoid restrictions imposed by some C compilers on long string literals (in particular, by the Microsoft C compiler cl that issued error C2026).
- Fixed a bug in finalized C code generation when calling Precursor in a routine which is recursively calling itself before the call to Precursor. Instead of generating the call to Precursor we would generate a recursive call to the routine.
- Fixed a bug where calls to standard_is_equal from ANY on objects whose type is generic would yield False where it should have been True.

### .NET issues

- Corrected processing of literal floating point fields from external assemblies (such as System.Math.PI) to obtain proper values.
- Fixed a bug where the value -1 was actually 255 on .NET.
- Fixed issue where declaring a NATIVE_ARRAY of a .NET expanded type would be rejected by the compiler.
- Fixed issue where assigning a .NET expanded type to an entity of type ANY would be rejected by the compiler.
- Fixed a crash in the compiler when generating the code for a class which inherits from a .NET class and from an Eiffel class which has some anchored types.
- Fixed a bug in assertion monitoring that could lead to wrong monitoring of assertions that are evaluated concurrently in different threads.
- Fixed a bug in code generation for entry point of executable when root procedure is a redeclaration of a deferred feature that caused an exception MissingMethodException to be raised on startup of such an application.
- Fixed a bug in code generation when solely inheriting from a .NET interface.
- Fixed a bug in code generation when inheriting from a .NET class which has a routine whose name is identical to one of the routine of ANY.
- Fixed a bug in code generation of custom attributes encoding in the case of a named argument whose base type is a .NET enum type.
- Improved conforms_to from ANY so that even though full generic conformance is still not yet supported, it checks it properly when the base class are the same.

### Store/Retrieve issues

- Fixed an issue where the GC would be disabled after a failure in a retrieval operation.