forked from dart-lang/sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Warn about deprecated native extensions
Fixes dart-lang#45759 Change-Id: I0162708a33aebec59edf6e7d3eb14b08e639e0af Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200924 Commit-Queue: Samuel Rawlins <srawlins@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
- Loading branch information
Showing
7 changed files
with
78 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
pkg/analyzer/test/src/diagnostics/use_of_native_extension_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) 2021, 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. | ||
|
||
import 'package:analyzer/src/error/codes.dart'; | ||
import 'package:test_reflective_loader/test_reflective_loader.dart'; | ||
|
||
import '../dart/resolution/context_collection_resolution.dart'; | ||
|
||
main() { | ||
defineReflectiveSuite(() { | ||
defineReflectiveTests(UseOfNativeExtensionTest); | ||
}); | ||
} | ||
|
||
@reflectiveTest | ||
class UseOfNativeExtensionTest extends PubPackageResolutionTest { | ||
test_export() async { | ||
await assertErrorsInCode(r''' | ||
export 'dart-ext:x'; | ||
''', [ | ||
error(HintCode.USE_OF_NATIVE_EXTENSION, 0, 20), | ||
error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 12), | ||
]); | ||
} | ||
|
||
test_import() async { | ||
await assertErrorsInCode(r''' | ||
import 'dart-ext:x'; | ||
''', [ | ||
// TODO(srawlins): Why does this file not have a URI_DOES_NOT_EXIST error? | ||
error(HintCode.USE_OF_NATIVE_EXTENSION, 0, 20), | ||
]); | ||
} | ||
} |