Skip to content

Instantly share code, notes, and snippets.

@brandondiamond
Created June 10, 2020 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandondiamond/423c87736f4d2fe506afcbb13550f24e to your computer and use it in GitHub Desktop.
Save brandondiamond/423c87736f4d2fe506afcbb13550f24e to your computer and use it in GitHub Desktop.
Reproducing incompatible signature bug
class Built<T extends Built<T, S>, S extends Builder<T, S>> {
}
class Builder<T extends Built<T, S>, S extends Builder<T, S>> {
}
class StatefulWidget {
}
class State<T extends StatefulWidget> {
}
mixin BrokenMixin<T extends Built<T, S>, S extends Builder<T, S>, U extends StatefulWidget> on State<U> {
void broken<V extends Built<V, W>, W extends Builder<V, W>>([void Function(T, V) func]) {
}
}
class ExampleBuilt extends Built<ExampleBuilt, ExampleBuilder> {
}
class ExampleBuilder extends Builder<ExampleBuilt, ExampleBuilder> {
}
class ExampleWidget extends StatefulWidget {
}
class ExampleWidgetState extends State<ExampleWidget> with BrokenMixin<ExampleBuilt, ExampleBuilder, ExampleWidget> {
void callBroken() {
broken<ExampleBuilt, ExampleBuilder>();
}
}
main() {
final example = ExampleWidgetState();
example.callBroken();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment