Skip to content

Cannot switch on a value of type String. #3049

Closed

Description

@siiikooo0743

Hi,

when i try to switch on an string i get this Error:
Cannot switch on a vlaue of type String. Only convertible int values or enum constatnts are permitted.
I know switching on String is not possbile in Java 1.6, but I'm using Processing V. 2.2.1, which has Java Version 1.7.0_40 (found out with: print(System.getProperty("java.version")); ).
This seems to be a bug in the error detection system.

Activity

  1. benfry commented on Jan 19, 2015

    @benfry
    Contributor

    It's not supported by the preprocessor, but we've never claimed it works: http://processing.org/reference/switch.html

    Use an if() statement instead.

  2. siiikooo0743 commented on Jan 20, 2015

    @siiikooo0743
    Author

    Well i know, but it should be supported anyway.
    I'm no expert, but how hard can it be to get it to work ^^

  3. benfry commented on Jan 20, 2015

    @benfry
    Contributor

    It's hard, because it involves the preprocessor. It's at least a few hours of work for someone to do it (and then update the reference accordingly), and there is no someone to do it.

    But regardless, it's not a "bug". It's a feature we've never had.

  4. siiikooo0743 commented on Jan 20, 2015

    @siiikooo0743
    Author

    Ok i undserstand.
    Thank you for your efforts anyway.

  5. github-actions commented on Jun 16, 2021

    @github-actions

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  6. locked as resolved and limited conversation to collaborators on Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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