【发布时间】:2019-01-29 20:47:58
【问题描述】:
我正在运行Ubuntu 18.04 LTS,使用单声道版本5.18.0.2140,如果我将netcore 与VS Code 一起使用,我的代码将不会在单声道下编译,但它会编译。但是,我需要使用单声道来完成这项作业,所以我不确定出了什么问题。我正在使用的命令是:
fsharpc --nologo chessApp.fsx && mono chessApp.exe
错误发生在这部分代码(from this line and down,底部的完整要点):
let playerOne = Chess.Human(Color.White) // Here
let playerTwo = Chess.Human(Color.Black) // Here
let game = new Chess.Game()
game.run(playerOne, playerTwo, board, pieces) // and here
我得到的错误如下:
chessApp.fsx(28,17): The object constructor 'Human' takes 0 argument(s) but is here given 1. The requried signature is 'new : unit -> Human'.
chessApp.fsx(29,17): The object constructor 'Human' takes 0 argument(s) but is here given 1. The requried signature is 'new : unit -> Human'.
chessApp.fsx(31,1): This value is not a function and cannot be applied.
我没有使用 VS Code 得到这些错误。它在那里工作。例如,Human 在 VS Code 上确实需要 1 个参数 netcore 可以识别,但 mono 不会。为了不让这个问题变得更长,我已将代码上传到 gist right here。
【问题讨论】:
标签: compiler-errors f# .net-core mono