3b67681bcc
Change-Id: Ife85aafa90b1b0347fabb6e95f3d6c00c5307cd2 Bug: https://github.com/dart-lang/sdk/issues/42063 Fixes: https://github.com/dart-lang/sdk/issues/42063 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152440 Reviewed-by: Joshua Litt <joshualitt@google.com> Commit-Queue: Mayank Patke <fishythefish@google.com>
108 lines
2.7 KiB
Dart
108 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() {
|
|
var c = new Class();
|
|
c.method1a(null);
|
|
c.method1b(null);
|
|
c.method2a(null);
|
|
c.method2b(null);
|
|
c.method3a(null);
|
|
c.method3b(null);
|
|
c.method4a(null);
|
|
c.method4b(null);
|
|
c.method5a(null);
|
|
c.method5b(null);
|
|
c.method6a(null);
|
|
c.method6b(null);
|
|
}
|
|
|
|
// Checks are needed both with and without --omit-implicit-checks.
|
|
/*class: Class1a:explicit=[Class1a*]*/
|
|
class Class1a {}
|
|
|
|
// Checks are needed neither with nor without --omit-implicit-checks.
|
|
/*class: Class1b:*/
|
|
class Class1b {}
|
|
|
|
// Checks are needed both with and without --omit-implicit-checks.
|
|
/*class: Class2a:explicit=[Class2a*]*/
|
|
class Class2a {}
|
|
|
|
// Checks are needed neither with nor without --omit-implicit-checks.
|
|
/*class: Class2b:*/
|
|
class Class2b {}
|
|
|
|
// Checks are needed both with and without --omit-implicit-checks.
|
|
/*class: Class3a:explicit=[Class3a*]*/
|
|
class Class3a {}
|
|
|
|
// Checks are needed neither with nor without --omit-implicit-checks.
|
|
/*class: Class3b:*/
|
|
class Class3b {}
|
|
|
|
// Checks are needed both with and without --omit-implicit-checks.
|
|
/*class: Class4a:explicit=[Class4a<int*>*],needsArgs*/
|
|
class Class4a<T> {}
|
|
|
|
// Checks are needed neither with nor without --omit-implicit-checks.
|
|
/*class: Class4b:*/
|
|
class Class4b<T> {}
|
|
|
|
// Checks are needed both with and without --omit-implicit-checks.
|
|
/*class: Class5a:explicit=[Class5a<int*>*],needsArgs*/
|
|
class Class5a<T> {}
|
|
|
|
// Checks are needed neither with nor without --omit-implicit-checks.
|
|
/*class: Class5b:*/
|
|
class Class5b<T> {}
|
|
|
|
// Checks are needed both with and without --omit-implicit-checks.
|
|
/*class: Class6a:explicit=[Class6a<int*>*],needsArgs*/
|
|
class Class6a<T> {}
|
|
|
|
// Checks are needed neither with nor without --omit-implicit-checks.
|
|
/*class: Class6b:*/
|
|
class Class6b<T> {}
|
|
|
|
class Class {
|
|
@pragma('dart2js:parameter:check')
|
|
method1a(Class1a c) {}
|
|
|
|
@pragma('dart2js:parameter:trust')
|
|
method1b(Class1b c) {}
|
|
|
|
@pragma('dart2js:downcast:check')
|
|
Class2a method2a(o) => o;
|
|
|
|
@pragma('dart2js:downcast:trust')
|
|
Class2b method2b(o) => o;
|
|
|
|
@pragma('dart2js:as:check')
|
|
method3a(o) => o as Class3a;
|
|
|
|
@pragma('dart2js:as:trust')
|
|
method3b(o) => o as Class3b;
|
|
|
|
@pragma('dart2js:parameter:check')
|
|
method4a(Class4a<int> c) {}
|
|
|
|
@pragma('dart2js:parameter:trust')
|
|
method4b(Class4b<int> c) {}
|
|
|
|
@pragma('dart2js:downcast:check')
|
|
Class5a<int> method5a(o) => o;
|
|
|
|
@pragma('dart2js:downcast:trust')
|
|
Class5b<int> method5b(o) => o;
|
|
|
|
@pragma('dart2js:as:check')
|
|
method6a(o) => o as Class6a<int>;
|
|
|
|
@pragma('dart2js:as:trust')
|
|
method6b(o) => o as Class6b<int>;
|
|
}
|