我試着寫下面的程序:使用Ada.Text_IO.Integer_IO
with Ada.Text_IO;
procedure Main is
type T is range 0 .. 18;
package IO is new Ada.Text_IO.Integer_IO (T);
begin
IO.Put (1);
end Main;
但是當我嘗試編譯,我得到以下錯誤信息:
main.adb:6:04: info: in instantiation at a-tiinio.ads:51 main.adb:6:04: info: "IO" requires body ("Get" requires completion) main.adb:6:04: info: in instantiation at a-tiinio.ads:56 main.adb:6:04: info: "IO" requires body ("Get" requires completion) main.adb:6:04: info: in instantiation at a-tiinio.ads:60 main.adb:6:04: info: "IO" requires body ("Put" requires completion) main.adb:6:04: info: in instantiation at a-tiinio.ads:66 main.adb:6:04: info: "IO" requires body ("Put" requires completion) main.adb:6:04: info: in instantiation at a-tiinio.ads:71 main.adb:6:04: info: "IO" requires body ("Get" requires completion) main.adb:6:04: info: in instantiation at a-tiinio.ads:76 main.adb:6:04: info: "IO" requires body ("Put" requires completion) a-tiinio.adb:59:07: (style) maximum nesting level exceeded a-tiinio.adb:79:07: (style) maximum nesting level exceeded a-tiinio.adb:100:07: (style) maximum nesting level exceeded a-tiinio.adb:121:07: (style) maximum nesting level exceeded a-tiinio.adb:134:07: (style) maximum nesting level exceeded a-tiinio.adb:147:07: (style) maximum nesting level exceeded
就我所瞭解的手冊的A.10.8而言,Integer_IO
是一個通用的包,需要用一個有符號的整數實例化。我也嘗試過subtype T is Integer
或Positive
,但我得到了同樣的錯誤。
我在做什麼錯?
您的程序編譯並正確運行;由於您的系統似乎在編譯'Ada.Text_IO.Integer_IO',您可能會遇到安裝問題。 – trashgod