mirror of
https://github.com/dart-lang/sdk
synced 2024-10-06 13:57:58 +00:00
[tests] Add repro for cross module constant
There is an issue with cross module constant extension types that causes the CFE to crash. Change-Id: Id6af3a5400e55ecb2534ce71a07c5c1ecb17a46f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335384 Commit-Queue: Nicholas Shahan <nshahan@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
parent
690b2ef0ca
commit
47b9e3e6df
7
tests/modular/const_extension_type/def.dart
Normal file
7
tests/modular/const_extension_type/def.dart
Normal file
|
@ -0,0 +1,7 @@
|
|||
// Copyright (c) 2023, 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.
|
||||
|
||||
const val = ExtString('hello');
|
||||
|
||||
extension type const ExtString(String s) {}
|
15
tests/modular/const_extension_type/main.dart
Normal file
15
tests/modular/const_extension_type/main.dart
Normal file
|
@ -0,0 +1,15 @@
|
|||
// Copyright (c) 2023, 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:expect/expect.dart';
|
||||
|
||||
import 'def.dart';
|
||||
|
||||
main() {
|
||||
ExtString x = val;
|
||||
fn(x);
|
||||
}
|
||||
|
||||
void fn(ExtString es) {
|
||||
Expect.equals('hello', es.toString());
|
||||
}
|
10
tests/modular/const_extension_type/modules.yaml
Normal file
10
tests/modular/const_extension_type/modules.yaml
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Copyright (c) 2023, 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.
|
||||
#
|
||||
# A constant created with an extension type should be assignable to the same
|
||||
# extension type in a different module.
|
||||
dependencies:
|
||||
main: [def, expect]
|
||||
flags:
|
||||
- inline-class
|
Loading…
Reference in a new issue