Skip to content

co19/LanguageFeatures/Patterns/switch_expression_A02_t01 #1693

@scheglov

Description

@scheglov

A few issues here - missing return before switch expressions, unresolved r.

FAILED: dart2analyzer-none release_arm64 co19/LanguageFeatures/Patterns/switch_expression_A02_t01
Expected: Pass
Actual: CompileTimeError

--- Command "dart2analyzer" (took 06.000137s):
DART_CONFIGURATION=ReleaseARM64 sdk/bin/dart --packages=.dart_tool/package_config.json pkg/analyzer_cli/bin/analyzer.dart --use-analysis-driver-memory-byte-store --dart-sdk=/Users/scheglov/Source/Dart/sdk.git/sdk/sdk -Dtest_runner.configuration=custom-configuration-1 --enable-experiment=patterns,records --ignore-unrecognized-flags --packages=/Users/scheglov/Source/Dart/sdk.git/sdk/.dart_tool/package_config.json --format=json /Users/scheglov/Source/Dart/sdk.git/sdk/tests/co19/src/LanguageFeatures/Patterns/switch_expression_A02_t01.dart

unexpected analysis errors in switch_expression_A02_t01.dart:
- Line 70, column 8: COMPILE_TIME_ERROR.BODY_MIGHT_COMPLETE_NORMALLY
  The body might complete normally, causing 'null' to be returned, but the return type, 'String', is a potentially non-nullable type.

- Line 72, column 5: SYNTACTIC_ERROR.EXPECTED_TOKEN
  Expected to find 'case'.

- Line 88, column 15: COMPILE_TIME_ERROR.CONSTANT_PATTERN_WITH_NON_CONSTANT_EXPRESSION
  The expression of a constant pattern must be a valid constant.

- Line 88, column 15: COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER
  Undefined name 'r'.

- Line 88, column 24: COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER
  Undefined name 'r'.

- Line 92, column 8: COMPILE_TIME_ERROR.BODY_MIGHT_COMPLETE_NORMALLY
  The body might complete normally, causing 'null' to be returned, but the return type, 'String', is a potentially non-nullable type.

- Line 94, column 5: SYNTACTIC_ERROR.EXPECTED_TOKEN
  Expected to find 'case'.

- Line 99, column 8: COMPILE_TIME_ERROR.BODY_MIGHT_COMPLETE_NORMALLY
  The body might complete normally, causing 'null' to be returned, but the return type, 'String', is a potentially non-nullable type.

- Line 101, column 5: SYNTACTIC_ERROR.EXPECTED_TOKEN
  Expected to find 'case'.

- Line 167, column 1: SYNTACTIC_ERROR.EXPECTED_TOKEN
  Expected to find '}'.

--- Re-run this test:
python3 tools/test.py -m release -c dart2analyzer -a arm64 co19/LanguageFeatures/Patterns/switch_expression_A02_t01

Metadata

Metadata

Assignees

Labels

bad-testReport tests in need of updates. When closed, the tests should be considered good

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions