Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2242. Change CRLF line endings to LF #2249

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
// Copyright (c) 2011, 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 When invoked from a constant object expression, a constant
/// constructor must throw an exception if any of its actual parameters is a
/// value that would prevent one of the potentially constant expressions within
/// it from being a valid compile-time constant.
/// @description Checks that compile-time error is produced if actual parameters
/// passed to the constructor make the constant initializer invalid. Note: this
/// mechanism is described in Classes.Constructors.Constant_Constructors.
/// @author iefremov
class A {
final x;
const A(var p) : x = p + 42;
}
main() {
DateTime d = new DateTime.now();
var a = const A(d.millisecond);
// ^
// [analyzer] unspecified
// [cfe] unspecified
}
// Copyright (c) 2011, 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 When invoked from a constant object expression, a constant
/// constructor must throw an exception if any of its actual parameters is a
/// value that would prevent one of the potentially constant expressions within
/// it from being a valid compile-time constant.
/// @description Checks that compile-time error is produced if actual parameters
/// passed to the constructor make the constant initializer invalid. Note: this
/// mechanism is described in Classes.Constructors.Constant_Constructors.
/// @author iefremov


class A {
final x;
const A(var p) : x = p + 42;
}

main() {
DateTime d = new DateTime.now();
var a = const A(d.millisecond);
// ^
// [analyzer] unspecified
// [cfe] unspecified
}
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
// Copyright (c) 2011, 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 When invoked from a constant object expression, a constant
/// constructor must throw an exception if any of its actual parameters is a
/// value that would prevent one of the potentially constant expressions within
/// it from being a valid compile-time constant.
/// @description Checks that compile-time error is produced if actual parameters
/// passed to the constructor make the constant initializer invalid. Note: this
/// mechanism is described in Classes.Constructors.Constant_Constructors.
/// @author iefremov
class A {
final x;
const A(var p) : x = p + 42;
}
class IntPair {
const IntPair(this.x, this.y);
final int x;
final int y;
operator +(int v) => new IntPair(x + v, y + v);
}
main() {
var a = const A(const IntPair(1, 2)); // parameter does not evaluate to int/bool/String, despite implementing the plus operator
// ^
// [analyzer] unspecified
// [cfe] unspecified
}
// Copyright (c) 2011, 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 When invoked from a constant object expression, a constant
/// constructor must throw an exception if any of its actual parameters is a
/// value that would prevent one of the potentially constant expressions within
/// it from being a valid compile-time constant.
/// @description Checks that compile-time error is produced if actual parameters
/// passed to the constructor make the constant initializer invalid. Note: this
/// mechanism is described in Classes.Constructors.Constant_Constructors.
/// @author iefremov


class A {
final x;
const A(var p) : x = p + 42;
}

class IntPair {
const IntPair(this.x, this.y);
final int x;
final int y;
operator +(int v) => new IntPair(x + v, y + v);
}

main() {
var a = const A(const IntPair(1, 2)); // parameter does not evaluate to int/bool/String, despite implementing the plus operator
// ^
// [analyzer] unspecified
// [cfe] unspecified
}
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
// Copyright (c) 2011, 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 When invoked from a constant object expression, a constant
/// constructor must throw an exception if any of its actual parameters is a
/// value that would prevent one of the potentially constant expressions within
/// it from being a valid compile-time constant.
/// @description Checks that compile-time error is produced if actual parameters
/// passed to the constructor make the constant initializer invalid. Note: this
/// mechanism is described in chapter Classes.Constructors.Constant_Constructors.
/// Constant constructor invocation is placed outside of main(), in a global
/// variable initialization expression.
/// @author iefremov
class A {
final x;
const A(var p) : x = p + 42;
}
var a = const A(new DateTime.now().millisecondsSinceEpoch);
// ^
// [analyzer] unspecified
// [cfe] unspecified
main() {
var b = a;
}
// Copyright (c) 2011, 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 When invoked from a constant object expression, a constant
/// constructor must throw an exception if any of its actual parameters is a
/// value that would prevent one of the potentially constant expressions within
/// it from being a valid compile-time constant.
/// @description Checks that compile-time error is produced if actual parameters
/// passed to the constructor make the constant initializer invalid. Note: this
/// mechanism is described in chapter Classes.Constructors.Constant_Constructors.
/// Constant constructor invocation is placed outside of main(), in a global
/// variable initialization expression.
/// @author iefremov


class A {
final x;
const A(var p) : x = p + 42;
}

var a = const A(new DateTime.now().millisecondsSinceEpoch);
// ^
// [analyzer] unspecified
// [cfe] unspecified

main() {
var b = a;
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
// Copyright (c) 2011, 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 It is a compile-time error if a constant constructor is declared
/// by a class that has a non-final instance variable.
/// @description Checks that a compile-time error is produced when a class with
/// constant constructor also declares a non-final instance variable.
/// @author iefremov
class A {
const A();
// ^
// [analyzer] unspecified
// [cfe] unspecified
var x;
}
main() {
const A();
}
// Copyright (c) 2011, 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 It is a compile-time error if a constant constructor is declared
/// by a class that has a non-final instance variable.
/// @description Checks that a compile-time error is produced when a class with
/// constant constructor also declares a non-final instance variable.
/// @author iefremov


class A {
const A();
// ^
// [analyzer] unspecified
// [cfe] unspecified
var x;
}

main() {
const A();
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
// Copyright (c) 2011, 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 It is a compile-time error if a constant constructor is declared
/// by a class that has a non-final instance variable.
/// @description Checks that compile-time error is produced when a class with
/// constant constructor inherits a non-final instance variable.
/// @author iefremov
class C {
var x;
}
class CC extends C {
}
class A extends CC {
const A();
// ^
// [analyzer] unspecified
// [cfe] unspecified
}
main() {
const A();
}
// Copyright (c) 2011, 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 It is a compile-time error if a constant constructor is declared
/// by a class that has a non-final instance variable.
/// @description Checks that compile-time error is produced when a class with
/// constant constructor inherits a non-final instance variable.
/// @author iefremov


class C {
var x;
}

class CC extends C {
}

class A extends CC {
const A();
// ^
// [analyzer] unspecified
// [cfe] unspecified
}

main() {
const A();
}
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
// Copyright (c) 2011, 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 Any expression that appears within the initializer list of a
/// constant constructor must be a potentially constant expression, or a
/// compile-time error occurs.
///
/// A potentially constant expression is an expression E that would be a valid
/// constant expression if all formal parameters of E's immediately enclosing
/// constant constructor were treated as compile-time constants that were
/// guaranteed to evaluate to an integer, boolean or string value as required
/// by their immediately enclosing superexpression.
/// @description Checks that it is a compile-time error when a constant
/// constructor's initializer list contains non-constant list literal.
/// @author iefremov
class A {
final x;
const A(var p) : x = [p];
// ^^^
// [analyzer] unspecified
// [cfe] unspecified
}
main() {
const A(1);
// ^
// [analyzer] unspecified
}
// Copyright (c) 2011, 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 Any expression that appears within the initializer list of a
/// constant constructor must be a potentially constant expression, or a
/// compile-time error occurs.
///
/// A potentially constant expression is an expression E that would be a valid
/// constant expression if all formal parameters of E's immediately enclosing
/// constant constructor were treated as compile-time constants that were
/// guaranteed to evaluate to an integer, boolean or string value as required
/// by their immediately enclosing superexpression.
/// @description Checks that it is a compile-time error when a constant
/// constructor's initializer list contains non-constant list literal.
/// @author iefremov


class A {
final x;
const A(var p) : x = [p];
// ^^^
// [analyzer] unspecified
// [cfe] unspecified
}

main() {
const A(1);
// ^
// [analyzer] unspecified
}
Loading
Loading