腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
1
回答
Scala
类型
不
匹配
;
找到
:
需要
Int
(
0
):
Int
scala
case class Wrapper[
Int
](value:
Int
) { def flatMap(f:
Int
=> Wrapper[
Int
]): Wrapper[
Int
] = f(value) def filter(f:
Int
=> Boolean):
浏览 14
提问于2018-12-24
得票数 0
回答已采纳
3
回答
错误:
类型
不
匹配
;
找到
:(
Int
,
Int
) =>
需要
Int
:
Int
scala
我是
scala
的新手,我不明白为什么这段代码会给我这个错误。def div(m:
Int
, n:
Int
, i:
Int
):
Int
= { if ((m - n) <=
0
) return i
浏览 1
提问于2011-09-14
得票数 1
1
回答
Scala
错误:发现
类型
不
匹配
:(
Int
,
Int
)
需要
=>
Int
: Ordering[
Int
]
scala
在
scala
中运行以下代码时,抛出错误
类型
不
匹配
if (isAscending) (x:
Int
, y:
Int
) => x+y else (x:
Int
, y:
Int
) => y - x
浏览 0
提问于2018-12-27
得票数 0
2
回答
类型
不
匹配
;
找到
:长期
需要
:
Int
scala
但我发现了一个错误:以下是一种方法: if (from < to) return from - new
scala
.util.Random().nextInt(Math.abs
浏览 3
提问于2016-04-02
得票数 4
回答已采纳
1
回答
类型
不
匹配
错误:
找到
SortedSet[
Int
],
需要
Set[
Int
]
scala
如果我尝试运行此命令,则会出现以下错误:found :
scala
.collection.SortedSet[String] required: Set
浏览 0
提问于2012-12-22
得票数 1
回答已采纳
1
回答
不
匹配
类型
`[
int
]` vs `[
int
,.[
0
]`
rust
我正面临一个铁锈的问题,我还没有
找到
答案:我的代码看起来是:}Foo {};
类型
应该是正确的,但也许大小不是。
浏览 1
提问于2014-09-08
得票数 1
回答已采纳
1
回答
scala
编译错误:
类型
不
匹配
;
找到
:
需要
的IndexedSeq[
Int
]:
scala
.collection.immutable.Seq[
Int
]
scala
、
compiler-errors
我不知道为什么下面的
scala
代码不能编译:def foo(nodes: Seq[
Int
]) = nullfoo(nodes)error: type mismatch; required:
scala
.collection.immutable.Seq[
Int
]
浏览 0
提问于2012-11-24
得票数 5
回答已采纳
2
回答
类型
不
匹配
,
找到
单位,
需要
Int
。使用模式
匹配
,
Scala
与Java库
java
、
scala
我正在尝试为spark注册一些udfs (用户定义函数),当我试图编译时,会得到以下代码的
类型
不
匹配
错误: val time: Calendar = Calendar.getInstance case &qu
浏览 2
提问于2015-07-02
得票数 0
回答已采纳
1
回答
Scala
:(
Int
,
Int
) =>
Int
与(
Int
,
Int
) =>
Int
不
匹配
scala
、
greatest-common-divisor
、
y-combinator
我正在尝试使用y-combinator在
scala
中定义gcd: def y[A,B]( f : (A => B) => A => B ) : A => B = f(y(f))}Main.
scala
Int
浏览 3
提问于2012-01-21
得票数 5
回答已采纳
1
回答
Scala
:函数组合中的
类型
不
匹配
,发现(
Int
,
Int
) => Seq[
Int
]
需要
?=> Seq[
Int
]
scala
、
type-systems
、
function-composition
我试图在一个脚本中编写两个函数,但遇到了一个我无法解决的
类型
不
匹配
问题。以下是示例代码: def generate(start:
Int
, end:
Int
): Seq[
Int
] = (start until end).toSeq val com: (
Int
,
Int
) =>
浏览 19
提问于2020-06-19
得票数 2
回答已采纳
2
回答
如何返回通配符泛型?
scala
、
typeclass
、
covariance
、
existential-type
、
singleton-type
{ case _ => (classTag[String], Option[String](""))这不起作用,给我带来了错误: 错误:
类型
错配;已
找到
:(
scala
.reflect.ClassTag_ >:
Int
,OptionAny)必需: TC (
scala
.reflect.ClassTag_$
浏览 0
提问于2019-08-30
得票数 0
回答已采纳
1
回答
找到
所需的
scala
.
Int
(
0
)
scala
我是
scala
的新手,我正在从图书中运行一些练习来实现一个列表。{}MList.
scala
:17: error: type mismatch; found :
scala
.
浏览 0
提问于2014-11-26
得票数 1
回答已采纳
2
回答
类型
与包含按位运算符的If语句
不
匹配
scala
、
types
、
bitwise-operators
、
type-mismatch
我是
scala
新手,但我在以下代码中遇到了问题:var j:
Int
=
0
for( j <-
0
to 100){the error }我得到的错误是:
类型
不
<
浏览 3
提问于2013-04-03
得票数 0
回答已采纳
2
回答
Scala
编译错误-
找到
:
需要
Int
:
Int
=>
Int
scala
、
function
、
literals
、
function-literal
我是
scala
的新手。println(y) x*2当我打电话给你我得到以下错误:<console>:15: error: type mismatch;required:
Int
=>
Int
^也请推荐一个很好的链接来理
浏览 8
提问于2016-10-19
得票数 1
1
回答
使用+运算符时
类型
不
匹配
scala
、
overloading
、
operator-keyword
我目前正在努力学习如何使用
Scala
,但我仍然遇到了一些语法问题。当我输入
scala
提示符时:var q = Queue[
Int
](1)我得到以下错误: found :
Int
(1) println((q+1)参数elem -要插入
浏览 3
提问于2016-06-21
得票数 0
回答已采纳
0
回答
Eclipse编译错误-
类型
不
匹配
;
找到
:
Scala
中
需要
的单元
Int
scala
我是
scala
的新手,开始用Eclipse编写一些代码。我有三个方法,其中第二个方法在subject中提到了错误 def add1(b:Byte):
Int
= sum+=b为什么第三种方法没有抱怨,而第二种方法有呢?那么,即使在第二个方法中声明了
Int
的返回
类型
,为什么
scala
不能理解第二个方法中的隐式返回,而对第三个方法也是如此呢?
浏览 1
提问于2016-07-17
得票数 0
回答已采纳
2
回答
Scala
类型
不
匹配
;
找到
:布尔值必需: List[
Int
]
scala
、
sbt
: tail => x + sum(tail) } def max(xs: List[
Int
]):
Int
= {[error] /home/milenko/dom1/example/src/test/
scala
/example/ListsSuite.
scala
:122: type mismat
浏览 2
提问于2017-03-17
得票数 0
回答已采纳
1
回答
路径相关的参数
类型
不强制(?)
scala
、
path-dependent-type
someLeft = Left(1)在REPL上尝试过:Loading Learn.
scala
...o: Outter = Outter@28037cedres
0
:
Int
=1 这让我感到困惑,因为Outter.f()有一个显式的路径依赖<e
浏览 3
提问于2016-02-22
得票数 0
回答已采纳
2
回答
scala
:
类型
错配(
找到
单位,您
需要
int
)
scala
刚刚从
Scala
开始。每次我尝试执行它时,都会显示一个
不
匹配
错误。我只返回整数。尽管如此,编译器还是从天知道哪里
找到
了Unit
类型
。object a { var l:
Int
=
0
return -1
浏览 3
提问于2015-10-22
得票数 1
回答已采纳
1
回答
从
Scala
函数返回参数化列表
list
、
scala
、
parameterized
我在以下代码中出错: List(1)错误说明如下:
类型
不
匹配
;
找到
:
scala
.collection.immutable.
scala
.collection.immutable.ListInt
浏览 0
提问于2014-10-24
得票数 0
点击加载更多
热门
标签
更多标签
云服务器
ICP备案
实时音视频
对象存储
即时通信 IM
活动推荐
运营活动
广告
关闭
领券