Files
sdk/pkg/compiler/test/annotations/data/errors.dart
T
Joshua Litt 20faaa5d94 [dart2js] Move dart2js unit tests to pkg/compiler/test.
Change-Id: Ib18f554c1076f27a3f7c0df5a36410da41a1f467
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148784
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-28 18:51:11 +00:00

84 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.
// @dart = 2.7
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() {}