File tree Expand file tree Collapse file tree 3 files changed +49
-0
lines changed Expand file tree Collapse file tree 3 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+ // for details. All rights reserved. Use of this source code is governed by a
3+ // BSD-style license that can be found in the LICENSE file.
4+
5+ // dart2jsOptions=--disable-type-inference
6+
7+ import 'package:expect/expect.dart' ;
8+
9+ void main () {
10+ final foo = Foo ();
11+ final bar = foo.mapLookup ('a' );
12+ Expect .equals ('c' , bar);
13+ }
14+
15+ class Foo {
16+ late var lateMap = < String , String > {};
17+
18+ String mapLookup (String key) {
19+ return lateMap.putIfAbsent (key, () => 'c' );
20+ }
21+ }
Original file line number Diff line number Diff line change 1+ // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+ // for details. All rights reserved. Use of this source code is governed by a
3+ // BSD-style license that can be found in the LICENSE file.
4+
5+ // dart2jsOptions=--disable-type-inference
6+
7+ import 'package:expect/expect.dart' ;
8+
9+ void main () {
10+ var uri
= Uri .
parse (
'https://[email protected] /pathsegment' );
11+ Expect .isFalse (uri.pathSegments.isEmpty);
12+ }
Original file line number Diff line number Diff line change 1+ // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+ // for details. All rights reserved. Use of this source code is governed by a
3+ // BSD-style license that can be found in the LICENSE file.
4+
5+ // dart2jsOptions=--disable-type-inference
6+
7+ import 'package:expect/expect.dart' ;
8+
9+ void main () {
10+ final foo = Foo ();
11+ Expect .equals ('foo' , foo.name);
12+ }
13+
14+ final class Foo {
15+ late final String name = 'foo' ;
16+ }
You can’t perform that action at this time.
0 commit comments