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

language/redirecting_factory_infinite_steps_test/01 #8129

Closed
scheglov opened this issue Jan 25, 2013 · 6 comments
Closed

language/redirecting_factory_infinite_steps_test/01 #8129

scheglov opened this issue Jan 25, 2013 · 6 comments
Labels
area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test). P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@scheglov
Copy link
Contributor

"factory Foo()" redirects to default Bar constructor in 1 step.
So, no warnings or errors.

cat /Users/scheglov/Source/Dart/dart/xcodebuild/ReleaseIA32/generated_tests/language/redirecting_factory_infinite_steps_test_01.dart

// Test created from multitest named /Users/scheglov/Source/Dart/dart/tests/language/redirecting_factory_infinite_steps_test.dart.
// Copyright (c) 2012, 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.

// From Dart Language Specification, 0.12 M1, "7.6.2 Factories": It is
// a compile-time error if a redirecting factory constructor does not
// redirect to a non-redirecting factory constructor or to a
// generative constructor in a finite number of steps.

// TODO(ahe): The above specification will probably change to
// something like: "It is a compile-time error if a redirecting
// factory constructor redirects to itself, either directly or
// indirectly via a sequence of redirections."

class Foo extends Bar {
  factory Foo() = Bar; /// 01: static type warning, dynamic type error
}

class Bar {
}

main() {
  new Foo();
}

@anders-sandholm
Copy link
Contributor

Removed this from the M3 milestone.
Added this to the M4 milestone.

@larsbak
Copy link

larsbak commented May 28, 2013

Removed this from the M4 milestone.
Added this to the M5 milestone.

@kasperl
Copy link

kasperl commented Jun 4, 2014

Removed this from the M5 milestone.
Added this to the 1.6 milestone.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the 1.6 milestone.
Added Oldschool-Milestone-1.6 label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-1.6 label.

@scheglov scheglov added Type-Defect area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test). labels Aug 4, 2014
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed triaged labels Feb 29, 2016
@askeksa-google
Copy link

The test in question is fixed now. Also, the code as written above is a compile-time error because Bar is not a subtype of Foo. See #32988

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test). P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

6 participants