- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am attempting to assign an array section, e.g.
X(1:N) = Y(1:N)
In the situation that Y has not been declared, the compiler only seems to look at the RHS of the statement, and so assumes that Y is intended to be of CHARACTER type, failing to recognize that the notation also could be an array section. Since the destination is an array section, then error message 6514 is misleading.
Error 1 error #6404: This name does not have a type, and must have an explicit type. [UNDECLAREDVAR] C:\Open\kwc54dw\Dev\Winyldmd\trunk\ymd_commands\Show_Stage.f90 107
Error 2 error #6514: A substring must be of type CHARACTER. [UNDECLAREDVAR] C:\Open\kwc54dw\Dev\Winyldmd\trunk\ymd_commands\Show_Stage.f90 107
Error 3 error #6303: The assignment operation or the binary expression operation is invalid for the data types of the two operands. [UNDECLAREDVAR] C:\Open\kwc54dw\Dev\Winyldmd\trunk\ymd_commands\Show_Stage.f90 107
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, the language doesn't make any connection between the left and right side of an assignment, and neither does the compiler. Generally, if something is not declared to be an array the compiler assumes it isn't one. But maybe error 6514 could be reworded to be something like "Substring or array slice notation for variable not declared as CHARACTER or array"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
I think your suggested wording for 6514 would make more sense. As it reads, it assumes that the n:m notation only applies to CHARACTER variables, which I guess was true before array slices were permitted.
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Escalated as issue ID DPD200368064.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fixed for a future major release.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page