blob: ac2a5dfd222973b9b115ad0f35f2a3096615668f [file] [log] [blame]
// Copyright (c) 2022, 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.
// Test that `FunctionNode`'s `futureValueType`s are correctly transformed.
// See for more details.
library futurevaluetype_test;
import 'dart:html';
import 'package:js/js.dart';
class JSWindow {}
// `futureValueType` corresponds to the `JSWindow` type parameter in the return
// value here. If this isn't correctly erased, we should see a runtime type
// error when using this method, as we'll be attemting to return a `@Native`
// type (`Window`) where a `package:js` type is expected instead of a
// `JavaScriptObject`.
Future<JSWindow> returnInteropType() async {
return window as JSWindow;
void main() async {
await returnInteropType();