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
typedef PathFunction = String Function([List<String> segment]); | |
PathFunction createPathFunction() { | |
// The type of this default list is not inferred from context. | |
// Typing the LHS or applying type arguments to the RHS fixes this. | |
return ([args = const []]) { | |
return '/${args.join('/')}'; | |
}; | |
} |
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 Value {} | |
class Renderer<T> {} | |
// When V is defined before R, type inference works in all cases. | |
class WorkingOrder<V extends Value, R extends Renderer<V>> {} | |
// When V is defined after R, type inference fails in some cases. | |
class BrokenOrder<R extends Renderer<V>, V extends Value> {} |
OlderNewer