8000 Switch expr and var incompatibility · Issue #4579 · javaparser/javaparser · GitHub 8000
[go: up one dir, main page]

Skip to content

Switch expr and var incompatibility #4579

@willome

Description

@willome

var is not allowed/recognized in this swith case expression:

switch (shape) {            
   case Circle(var radius) -> {
       double circleArea = Math.PI * radius * radius;
       System.out.println("Area of Circle: " + circleArea);            
   }            
   case Rectangle(var width, var height) -> {                  
     double rectangleArea = width * height;                
     System.out.println("Area of Rectangle: " + rectangleArea);            
   }        
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0