Skip to content

Spore factory alias breaks Spore.apply(summon) type inference #30

@jspenger

Description

@jspenger

The latest commit which added an alias to the Spore factory now breaks the following example.

given Spore[ReadWriter[FibMessage]] = Spore.apply(summon)
//                                                ^^^^^^
// No implicit search was attempted for parameter x of method summon in object Predef
// since the expected type T is not specific enough
// 
// where:    T is a type variable

Note that this general pattern was also shown in the slides for the presentation at Scala Days 2025.

To fix it, one needs to make the type argument explicit for summon.

given Spore[ReadWriter[FibMessage]] = Spore.apply(summon[ReadWriter[FibMessage]])

This issue serves two purposes: to inform others which may copy the example from the slide deck; and to discuss if this should be fixed in later versions.

Should the new alias be removed from future versions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions