This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2009 10gen Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////////////// Background /////////////// | |
/* | |
(The test case that appears below may do a better job of explaning than this wall of text :) | |
I recently noticed this calculation while investigating some framework code: | |
https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/rendering/sliver_fixed_extent_list.dart#L235 | |
There's an associated test case, and though it makes sense, I think it misses a potential issue: | |
https://github.com/flutter/flutter/blob/master/packages/flutter/test/widgets/slivers_evil_test.dart#L255 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class RootOverlayInjector extends Overlay { | |
final Widget child; | |
const RootOverlayInjector({Key key, this.child}) | |
: super(key: key, initialEntries: const []); | |
@override | |
_RootOverlayInjectorState createState() => _RootOverlayInjectorState(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Pair<T extends Pair<T, S>, S extends Pair<T, S>> {} | |
mixin BrokenMixin<T extends Pair<T, S>, S extends Pair<T, S>> { | |
void broken<V extends Pair<V, W>, W extends Pair<V, W>>([void Function(T, V) func]) {} | |
} | |
class Example with BrokenMixin<Null, Null> {} | |
main() { | |
Example().broken<Null, Null>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Identifiable<T> { | |
Id<T> id; | |
} | |
class Id<T> {} | |
class Person extends Identifiable<Person> {} | |
class Animal extends Identifiable<Animal> {} |