You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importscala.reflect.Selectable.reflectiveSelectableobjectTest {
defmain(args: Array[String]):Unit= {
classFoo {
defmakeInt:Int=5deftestInt(x: Int):Unit= assert(5== x)
defmakeRef:Option[String] =Some("hi")
deftestRef(x: Option[String]):Unit= assert(Some("hi") == x)
}
deftest(foo: {
defmakeInt:IntdeftestInt(x: Int):UnitdefmakeRef:Option[String]
deftestRef(x: Option[String]):Unit
}):Unit= {
foo.testInt(foo.makeInt)
// ^// cannot infer type; expected type <?> is not fully defined
foo.testRef(foo.makeRef)
// ^// cannot infer type; expected type <?> is not fully defined
}
test(newFoo)
}
}
Output
--Error: tests/run/hello.scala:24:29------------------------------------------24| foo.testInt(foo.makeInt)
|^| cannot infer type; expected type<?> is not fully defined
1 error found
(if we comment that line, the same error appears on the next line)
Expectation
All types are completely defined here, so I expect that there's nothing to be inferred, and therefore the "cannot infer type" error message doesn't make sense to me. I expect this code to compile and successfully run.
The text was updated successfully, but these errors were encountered:
Minimized code
Output
(if we comment that line, the same error appears on the next line)
Expectation
All types are completely defined here, so I expect that there's nothing to be inferred, and therefore the "cannot infer type" error message doesn't make sense to me. I expect this code to compile and successfully run.
The text was updated successfully, but these errors were encountered: