test/langtools/tools/javac/switchexpr/DefiniteAssignment2.java
changeset 55306 ea43db53de91
parent 53878 4584d0331318
child 59021 cfc7bb9a5a92
equal deleted inserted replaced
55305:6e432194ee97 55306:ea43db53de91
    13 
    13 
    14         {
    14         {
    15             int x;
    15             int x;
    16 
    16 
    17             t = (b && switch(a) {
    17             t = (b && switch(a) {
    18                 case 0: break (x = 1) == 1 || true;
    18                 case 0: yield (x = 1) == 1 || true;
    19                 default: break false;
    19                 default: yield false;
    20             }) || x == 1;
    20             }) || x == 1;
    21         }
    21         }
    22 
    22 
    23         {
    23         {
    24             int x;
    24             int x;
    25 
    25 
    26             t = (switch(a) {
    26             t = (switch(a) {
    27                 case 0: break (x = 1) == 1;
    27                 case 0: yield (x = 1) == 1;
    28                 default: break false;
    28                 default: yield false;
    29             }) || x == 1;
    29             }) || x == 1;
    30         }
    30         }
    31 
    31 
    32         {
    32         {
    33             int x;
    33             int x;
    34 
    34 
    35             t = (switch(a) {
    35             t = (switch(a) {
    36                 case 0: x = 1; break true;
    36                 case 0: x = 1; yield true;
    37                 case 1: break (x = 1) == 1;
    37                 case 1: yield (x = 1) == 1;
    38                 default: break false;
    38                 default: yield false;
    39             }) || x == 1;
    39             }) || x == 1;
    40         }
    40         }
    41 
    41 
    42         {
    42         {
    43             int x;
    43             int x;
    44 
    44 
    45             t = (switch(a) {
    45             t = (switch(a) {
    46                 case 0: break true;
    46                 case 0: yield true;
    47                 case 1: break (x = 1) == 1;
    47                 case 1: yield (x = 1) == 1;
    48                 default: break false;
    48                 default: yield false;
    49             }) && x == 1;
    49             }) && x == 1;
    50         }
    50         }
    51 
    51 
    52         {
    52         {
    53             int x;
    53             int x;
    54 
    54 
    55             t = (switch(a) {
    55             t = (switch(a) {
    56                 case 0: break false;
    56                 case 0: yield false;
    57                 case 1: break isTrue() || (x = 1) == 1;
    57                 case 1: yield isTrue() || (x = 1) == 1;
    58                 default: break false;
    58                 default: yield false;
    59             }) && x == 1;
    59             }) && x == 1;
    60         }
    60         }
    61 
    61 
    62         {
    62         {
    63             int x;
    63             int x;
    64 
    64 
    65             t = (switch(a) {
    65             t = (switch(a) {
    66                 case 0: break false;
    66                 case 0: yield false;
    67                 case 1: break isTrue() ? true : (x = 1) == 1;
    67                 case 1: yield isTrue() ? true : (x = 1) == 1;
    68                 default: break false;
    68                 default: yield false;
    69             }) && x == 1;
    69             }) && x == 1;
    70         }
    70         }
    71 
    71 
    72         {
    72         {
    73             final int x;
    73             final int x;
    74 
    74 
    75             t = (switch(a) {
    75             t = (switch(a) {
    76                 case 0: break false;
    76                 case 0: yield false;
    77                 case 1: break isTrue() ? true : (x = 1) == 1;
    77                 case 1: yield isTrue() ? true : (x = 1) == 1;
    78                 default: break false;
    78                 default: yield false;
    79             }) && (x = 1) == 1;
    79             }) && (x = 1) == 1;
    80         }
    80         }
    81     }
    81     }
    82 
    82 
    83     private static boolean isTrue() {
    83     private static boolean isTrue() {