-
Notifications
You must be signed in to change notification settings - Fork 29
Closed
Labels
bad-testReport tests in need of updates. When closed, the tests should be considered goodReport tests in need of updates. When closed, the tests should be considered good
Description
The following line in a patterns test results in a runtime error.
| Expect.isFalse(matches(["1", 3])); |
The failure happens when the list literal from that line is checked agains a pattern in another line.
| [> 0 && <= 2, 3] => true, |
As I understand it, an object with the runtime type String is passed as an element of the list of static type List<dynamic>. The process of matching against the pattern invokes operator < on the object, which a String doesn't have. It results in an error.
The stack trace is as follows:
stderr:
Unhandled exception:
NoSuchMethodError: Class 'String' has no instance method '>'.
Receiver: "1"
Tried calling: >(0)
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:38:5)
#1 matches (file:///b/s/w/ir/tests/co19/src/LanguageFeatures/Patterns/logical_and_A01_t02.dart)
#2 main (file:///b/s/w/ir/tests/co19/src/LanguageFeatures/Patterns/logical_and_A01_t02.dart:34:18)
#3 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:297:19)
#4 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:192:26)
Metadata
Metadata
Assignees
Labels
bad-testReport tests in need of updates. When closed, the tests should be considered goodReport tests in need of updates. When closed, the tests should be considered good