Bug 83188 - A class-wide type is considered different than itself
Summary: A class-wide type is considered different than itself
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 7.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2017-11-27 22:40 UTC by Victor Porton
Modified: 2017-11-27 22:40 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
a valid program which does not compile (658 bytes, text/plain)
2017-11-27 22:40 UTC, Victor Porton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Porton 2017-11-27 22:40:09 UTC
Created attachment 42734 [details]
a valid program which does not compile

The attached valid program (run `gnatchop script.all`) does not compile.

Weirdly enough, it compiles if I add `subtype X is Script_Info'Class;` in the beginning of Resource.Parser package and replace all occurrences of Script_Info'Class in resource-parser.ads and resource-parser.adb with `X`.

$ gcc --version
gcc (Debian 7.2.0-16) 7.2.0

$ make
gprbuild -p main.gpr
Compile
   [Ada]          resource-parser.adb
resource-parser.ads:10:24: not subtype conformant with operation inherited at line 7
resource-parser.ads:10:24: return type does not match