Skip to content

Change return values to singleton strings #46

Open
@soronpo

Description

@soronpo

If the string values returned will be singleton values (<: String with Singleton), then it's possible to perform more string operations at compile-time (using singleton-ops), and possibly even enforce naming conventions. E.g.:

def foo(implicit n: sourcecode.Name.Aux[N], check: RequireMsg[Substring[N, 3]=="Fun", "Name must start with Fun"] : Unit = {}
val Fun1 = foo //OK
val fun2 = foo //Error: "Name must start with Fun"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions