mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
Add fuzz tests for annotation resolution crashes.
Change-Id: I2748ae2bee93b621f864c11dc4d58ec9b1e4b9fb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119581 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
989289c36f
commit
8c3065e947
1 changed files with 23 additions and 0 deletions
|
@ -166,6 +166,29 @@ const v = [<S extends num>(S x) => x is int ? x : 0];
|
|||
''');
|
||||
}
|
||||
|
||||
test_fuzz_15() async {
|
||||
// `@A` is not a valid annotation, it is missing arguments.
|
||||
// There was a bug that we did not check for arguments being missing.
|
||||
await _assertCanBeAnalyzed(r'''
|
||||
class A<T> {}
|
||||
|
||||
@A
|
||||
class B {}
|
||||
''');
|
||||
}
|
||||
|
||||
test_fuzz_16() async {
|
||||
// The default constructor of `A` does not have formal parameters.
|
||||
// But we give it arguments.
|
||||
// There was a bug that we did not check for this mismatch.
|
||||
await _assertCanBeAnalyzed(r'''
|
||||
class A<T> {}
|
||||
|
||||
@A(0)
|
||||
class B {}
|
||||
''');
|
||||
}
|
||||
|
||||
test_fuzz_38091() async {
|
||||
// https://github.com/dart-lang/sdk/issues/38091
|
||||
// this caused an infinite loop in parser recovery
|
||||
|
|
Loading…
Reference in a new issue