merged 18.07 into trunk

git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@2102 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
eiffel-org
2018-12-03 10:15:23 +00:00
parent 8a52104c2a
commit 8c687ec4a5
18 changed files with 1073 additions and 860 deletions

View File

@@ -1,6 +1,27 @@
[[Property:modification_date|Fri, 06 Jul 2018 13:21:44 GMT]]
[[Property:modification_date|Mon, 19 Nov 2018 16:49:36 GMT]]
[[Property:publication_date|Fri, 06 Jul 2018 13:19:54 GMT]]
[[Property:uuid|26E32CD7-7C68-4CDD-A29A-81343EC0DD3B]]
[[Property:weight|0]]
[[Property:title|VWMA(1)]]
[[Property:link_title|VWMA(1)]]
In legacy code, before EiffelStudio [[/doc/uuid/73F20392-AB22-4CD6-BFE5-83296B8BD64B|18.07]], the target of a reattachment could be used to determine the type of a manifest array. For example, with the declaration
```eiffel
x: ARRAY [READABLE_STRING_GENERAL]
```
the reattachment
```eiffel
x := <<"abc", "def">>
```
led to creation of an array of type <eiffel>ARRAY [READABLE_STRING_GENERAL]</eiffel> with elements <eiffel>"abc"</eiffel> and <eiffel>"def"</eiffel> of type <eiffel>STRING_8</eiffel>.
In Eiffel, manifest arrays were the only expressions whose type depended on the type of the target. Starting from EiffelStudio [[/doc/uuid/61F63EE2-58B1-4061-927B-35D4F66EDD9B|18.01]] this is no longer the case, and, by default, the type of a manifest array does not depend on the context where the manifest array is used.
Taking the rules into account, the type of the manifest array object from the example above is <eiffel>ARRAY [STRING_8]</eiffel>.
For projects that were developed before EiffelStudio [[/doc/uuid/61F63EE2-58B1-4061-927B-35D4F66EDD9B|18.01]], the compiler checks whether a computed manifest array type is the same as the type of the target of reattachment and reports the warning {{Inline-Warning|VWMA(1)}} to simplify adaptation of legacy code to the new semantics. If the old semantics has to be preserved, an explicit manifest array type has to be used, for example:
```eiffel
x := {ARRAY [READABLE_STRING_GENERAL]} <<"abc", "def">>
```
The code above would have the behavior identical to the behavior of projects created by the versions before EiffelStudio [[/doc/uuid/61F63EE2-58B1-4061-927B-35D4F66EDD9B|18.01]].
After updating all code to follow the standard rules, the project option '''Manifest array type''' can be set to '''standard''' to switch to the standard behavior and to disable comparing types of a manifest array and the target of the attachment. To make sure all occurrences of reattachment of manifest arrays to targets of non-matching types are fixed, the option can also be set to '''mismatch error'''. That would trigger errors instead of warnings for manifest array type mismatches.

View File

@@ -0,0 +1,16 @@
[[Property:modification_date|Mon, 10 Sep 2018 10:49:19 GMT]]
[[Property:publication_date|Mon, 10 Sep 2018 10:32:05 GMT]]
[[Property:uuid|81E6A18A-C7D8-4F80-8D08-8B2C0B6350C8]]
[[Property:weight|0]]
[[Property:title|Language and Capabilities]]
The sections '''Language''' and '''Capability''' list closely-related options that work together. The values in the section '''Language''' specify what rules or semantics the compiler should apply when compiling and running code. If not specified, the value of the corresponding option from the section '''Capability''' is used. A selected value in the section '''Language''' should be compatible with the value in the section '''Capability'''. In other words, the values listed in '''Capability''' tell what source code is capable of, whereas the values in '''Language''' tell what is used when compiling for a specific target.
The values in the section '''Language''' are used only when the corresponding target is compiled as a root one. Otherwise, they are ignored. The values in the section '''Capability''' are used to verify that current project settings allow for using a particular library (or classes of the project itself). For example, the [https://www.eiffel.org/doc/uuid/a03568e8-eb79-70d7-04a3-6fd3ed7ac2b3 void-safe] library ''[https://www.eiffel.org/doc/uuid/0153c1de-bf88-fa0d-52a5-e50ffcc4e8c8 Base]'' can be used in a non-void-safe project, because project settings are compatible with capabilities of the library. On the other hand, the library ''[https://www.eiffel.org/doc/uuid/AAF0CEF9-7268-492F-9119-872164995898 Thread]'' cannot be used in a [https://www.eiffel.org/doc/uuid/5FE312E0-0AC6-465C-AD3B-D5D73AAE566F SCOOP] project, because the library is not SCOOP-capable.
Capabilities are supported for the following settings, listed together with compatibility order, where ''X < Y'' means ''X'' is compatible with ''Y'':
# CAT-call detection: None < Transitional < Complete.
# Concurrency: Thread < None < SCOOP.
# Void safety: None < Conformance < Initialization < Transitional < Complete.
In addition to the restriction on the compilation setting specified in the section '''Language''', a project or a library with a higher level of capabilities cannot rely on a library with a lower level.