Skip to content

LanguageFeatures/Super-parameters/semantics_A06_t19 #1247

@scheglov

Description

@scheglov
LanguageFeatures/Super-parameters/semantics_A06_t19: Fail
LanguageFeatures/Super-parameters/semantics_A06_t20: Fail
LanguageFeatures/Super-parameters/semantics_A06_t23: Fail
LanguageFeatures/Super-parameters/semantics_A06_t24: Fail
LanguageFeatures/Super-parameters/semantics_A06_t25: Fail

Code like:

class S {
  int s1;
  S(int x1) : s1 = x1;
}

class C extends S {
  int i1;
  int i2;
  C(this.i1, super.s1, int x) : this.i2 = x;
//           ^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

Here, it is OK to use super.s1 - it is the 1th super-formal in C, and its associated super-constructor parameter is x1. The spec says "If p is a positional parameter, let j be the number of positional super-parameters of C up to and including p in source order. The associated super-constructor parameter of p is the jth positional parameter of D (1-based), if D has that many positional parameters."

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions