From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, WEIRD_PORT autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:21cd:: with SMTP id e196-v6mr4596581ita.23.1541846189474; Sat, 10 Nov 2018 02:36:29 -0800 (PST) X-Received: by 2002:a9d:5403:: with SMTP id j3mr207632oth.2.1541846189195; Sat, 10 Nov 2018 02:36:29 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!2.eu.feeder.erje.net!4.us.feeder.erje.net!feeder.erje.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!g188-v6no1340785itg.0!news-out.google.com!n199-v6ni2171itn.0!nntp.google.com!z5-v6no1334937ite.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 10 Nov 2018 02:36:28 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=80.76.167.69; posting-account=QyztswoAAADMpLjqBKxiGq6giZCkeW04 NNTP-Posting-Host: 80.76.167.69 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <33246c2f-a26c-4744-b468-0a7637bc838f@googlegroups.com> Subject: "Equality operator appears too late" From: JLotty Injection-Date: Sat, 10 Nov 2018 10:36:29 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:54806 Date: 2018-11-10T02:36:28-08:00 List-Id: with Ada.Containers.Synchronized_Queue_Interfaces; with Ada.Containers.Unbounded_Priority_Queues; procedure Min_Working_Example is generic type Data_Type is private; type Weight_Type is (<>); with function "<" (Left, Right : Weight_Type) return Boolean is <>; package Min_Data_Structure is private type Data_Rec is record Data : Data_Type; Weight : Weight_Type; end record; function Get_Priority (Element : Data_Rec) return Weight_Type; function Before (Left, Right : Weight_Type) return Boolean; package Queue_Interface is new Ada.Containers.Synchronized_Queue_Interfaces (Data_Rec); package Edge_Queue is new Ada.Containers.Unbounded_Priority_Queues (Queue_Interfaces => Queue_Interface, Queue_Priority => Weight_Type, Get_Priority => Get_Priority, Before => Before); end Min_Data_Structure; package body Min_Data_Structure is function Get_Priority (Element : Data_Rec) return Weight_Type is (Element.Weight); function Before (Left, Right : Weight_Type) return Boolean is (Left < Right); end Min_Data_Structure; begin null; end Min_Working_Example; ================================================== When compiling the above, I get the following error: Builder results min_working_example.adb 27:7 equality operator appears too late 27:7 instantiation error at a-cuprqu.ads:76 The error is occurring when the builder tries to elaborate the Ada.Containers.Unbounded_Priority_Queues package, where and "=" operator is defined on line 76. I'm running the following command for build: gprbuild -q -c -f -gnatc -u -Ptest.gpr min_working_example.adb using version: GPRBUILD GPL 2017 (20170515) (x86_64-pc-linux-gnu) Copyright (C) 2004-2017, AdaCore I don't know what to do from here. Any help you can offer would be appreciated.