Skip to content

SAM type does not support dependent type #9897

Open
@scabug

Description

@scabug
$ scala -Xexperimental
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_77).
Type in expressions for evaluation. Or try :help.

scala>     trait Container {
     |       type Child
     | 
     |       def child: Child
     |     }
defined trait Container

scala>     trait Sam {
     |       def apply(container: Container): container.Child
     |     }
defined trait Sam

scala>     val sam: Sam = { container: Container => container.child }
<console>:13: error: type mismatch;
 found   : container.Child
 required: container.Child
           val sam: Sam = { container: Container => container.child }
                                                 ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions