blob: 484e32954209d48599d02a6a5b812b85b4e7e1ec [file] [log] [blame]
// 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.
/// @assertion Instances of a subclass of Union have reference semantics and
/// are backed by native memory. The may allocated via allocation or loaded from
/// a Pointer, but cannot be created by a generative constructor.
/// @description Checks that instances of the Union subclass cannot be created
/// by generative constructors
/// @author
/// @issue 46191
import "dart:ffi";
class U1 extends Union {
external int i;
U1(int x) {
i = x;
void main() {
U1 u1 = new U1(42);
// ^^
// [analyzer] unspecified
// [cfe] unspecified