我在VDM++ ToolBox Academic中遇到一个愚蠢的错误。
当我尝试运行操作时,出现以下错误:
Run-Time Error 280: No constructor with this parameter list is in scope
value: "Game"
public Game: Date * Team * Team ==> Game
Game(d,t1,t2) == (
matchday := d;
host := t1;
visitor := t2;
return self;
);
game := new Game(matchday1day1,groupA.teams(2),groupA.teams(3));
public groupA : Group;
public matchday1day1 : Date;
public teams : seq of Team;
Game
的第一个字母。最佳答案
如果我正确阅读了您对模型的描述,那么它应该看起来像这样:
class Group
instance variables
public teams : seq of Team := [new Team(),new Team(),new Team()];
end Group
class Team
end Team
class Date
end Date
class Game
instance variables
matchday: Date;
host : Team;
visitor : Team;
operations
public Game: Date * Team * Team ==> Game
Game(d,t1,t2) == (
matchday := d;
host := t1;
visitor := t2;
return self;
);
end Game
class Test
instance variables
public groupA : Group := new Group();
public matchday1day1 : Date := new Date();
operations
public test : ()==>()
test()== (
dcl game : Game;
game := new Game(matchday1day1,groupA.teams(2),groupA.teams(3)) ;
)
end Test
https://stackoverflow.com/questions/13685863/
相关文章:
compiler-errors - 虽然放在mingw文件夹中,但找不到包含的库头文件
sdk - CUDA 5.0 : checkCudaErrors fails to find cor
compiler-errors - sun.misc.InvalidJarIndexExceptio
android - Android “The specified child already has
android - 在Android版Eclipse中使用新版本的开发工具等时出错
objective-c - XCode 4.5中的工作区/编译/库问题,试图集成Box2DCocos