Skip to content

Singleton-type inference in method return type #9023

Closed
@scabug

Description

@scabug

According to SLS, a type in value definition(in method definition, too) is not determined by the local type inference, so

scala> val p = "hello"
p: String = hello

scala> val v = p : p.type
v: p.type = hello

seems ok, but

scala> def v = p : p.type
v: String

. Or SLS is wrong?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions