Skip to content

Support API profiles in the style of -release #17690

Closed
@som-snytt

Description

@som-snytt

A sample homework:

Hey does anyone know how I can add an element to the end of a list in scala WITHOUT using :+?
I'm working on this recursion problem for my homework and the instruction is that I can only use List.empty, .isEmpty, .nonEmpty, .:: (cons), .head, .tail

It would be nice if a student could scalac --profile:homework1 which would surface only the allowed API on the classpath. This would work similarly to --release. The trick might be how to make it easy to specify and generate the permitted API as a ct.sym file.

IRL projects could use such a facility to restrict API usage. In particular, it would not only restrict to a platform version like -release, but disallow methods deemed substandard for any reason.

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