Files
sdk/pkg/compiler/test/annotations/data/errors.dart
T
Nate Biggs 41b1ba7705 [dart2js] Migrate test/annotations for null safety migration.
Change-Id: I1739d7ba9b7cad1ffb179c9fa6cc46f21afd8821
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279243
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-23 06:02:51 +00:00

82 lines
2.7 KiB
Dart

// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
main() {
unknown();
noInlineField;
tryInlineField;
noThrowsWithoutNoInline();
noSideEffectsWithoutNoInline();
asConflict1();
asConflict2();
parameterConflict1();
parameterConflict2();
downcastConflict1();
downcastConflict2();
typesConflict1();
typesConflict2();
}
@pragma('dart2js:unknown')
/*error: [Unknown dart2js pragma @pragma('dart2js:unknown')]*/
unknown() {}
@pragma('dart2js:noInline')
var
/*error: [@pragma('dart2js:noInline') annotation is only supported for methods and constructors.]*/
noInlineField;
@pragma('dart2js:tryInline')
var
/*error: [@pragma('dart2js:tryInline') annotation is only supported for methods and constructors.]*/
tryInlineField;
@pragma('dart2js:noThrows')
/*error: [@pragma('dart2js:noThrows') should always be combined with @pragma('dart2js:noInline').]*/
noThrowsWithoutNoInline() {}
@pragma('dart2js:noSideEffects')
/*error: [@pragma('dart2js:noSideEffects') should always be combined with @pragma('dart2js:noInline').]*/
noSideEffectsWithoutNoInline() {}
@pragma('dart2js:as:trust')
@pragma('dart2js:as:check')
/*error: [@pragma('dart2js:as:check') must not be used with @pragma('dart2js:as:trust').]*/
asConflict1() {}
@pragma('dart2js:as:trust')
@pragma('dart2js:as:check')
/*error: [@pragma('dart2js:as:check') must not be used with @pragma('dart2js:as:trust').]*/
asConflict2() {}
@pragma('dart2js:parameter:trust')
@pragma('dart2js:parameter:check')
/*error: [@pragma('dart2js:parameter:check') must not be used with @pragma('dart2js:parameter:trust').]*/
parameterConflict1() {}
@pragma('dart2js:parameter:trust')
@pragma('dart2js:parameter:check')
/*error: [@pragma('dart2js:parameter:check') must not be used with @pragma('dart2js:parameter:trust').]*/
parameterConflict2() {}
@pragma('dart2js:downcast:trust')
@pragma('dart2js:downcast:check')
/*error: [@pragma('dart2js:downcast:check') must not be used with @pragma('dart2js:downcast:trust').]*/
downcastConflict1() {}
@pragma('dart2js:downcast:trust')
@pragma('dart2js:downcast:check')
/*error: [@pragma('dart2js:downcast:check') must not be used with @pragma('dart2js:downcast:trust').]*/
downcastConflict2() {}
@pragma('dart2js:types:trust')
@pragma('dart2js:types:check')
/*error: [@pragma('dart2js:types:check') must not be used with @pragma('dart2js:types:trust').]*/
typesConflict1() {}
@pragma('dart2js:types:trust')
@pragma('dart2js:types:check')
/*error: [@pragma('dart2js:types:check') must not be used with @pragma('dart2js:types:trust').]*/
typesConflict2() {}