所以我想说我想创建一个名为ImportFunc的自定义函数类型,它接受一个名为fileImportID的Int和一个名为filename的字符串.我可以使用像这样的类型别名轻松地做到这一点:
type ImportFunc = (Int, String) => Unit
Run Code Online (Sandbox Code Playgroud)
问题是,任何试图使用此函数的人都不知道Int和String实际上应该是什么.有什么方法可以写出像:
type ImportFunc = (fileImportID: Int, filename: String) => Unit
Run Code Online (Sandbox Code Playgroud)