Skip to content

Instantly share code, notes, and snippets.

View kallentu's full-sized avatar
🏔️

Kallen Tu kallentu

🏔️
  • Google
  • 15:31 (UTC -07:00)
View GitHub Profile
@kallentu
kallentu / gist:f996adb3e4a9f5bc93e418a521d93460
Created June 20, 2024 22:21
cfe failure on wildcard class type parameters
/==================================================================================================================\
| pkg/front_end/test/fasta/strong/wildcard_variables/class_type_parameters is new and failed (Fail, expected Pass) |
\==================================================================================================================/
library;
import self as self;
import "dart:core" as core;
@kallentu
kallentu / edgeinsets.txt
Created April 2, 2024 21:48
EdgeInset reference from dart doc flutter
building flutter docs into: Directory: '/tmp/flutterRDUIZE'
copying /usr/local/google/home/kallentu/.pub-cache to /tmp/pubcacheTTCOEX
flutter-clean: % Total % Received % Xferd Average Speed Time Time Time Current
flutter-clean: Dload Upload Total Spent Left Speed
flutter-clean:
flutter-clean: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
flutter-clean: 1 221M 1 4096k 0 0 18.7M 0 0:00:11 --:--:-- 0:00:11 18.6M
flutter-clean: 54 221M 54 119M 0 0 104M 0 0:00:02 0:00:01 0:00:01 104M
flutter-clean: 100 221M 100 221M 0 0 117M 0 0:00:01 0:00:01 --:--:-- 117M
flutter-clean: Resolving dependencies...
class Writer<in T> {
void write(T value) => print(value);
}
class Reader<out T> {
final T value;
Reader(this.value);
T read() => value;
}
class ReaderWriter<inout T> {}
class NewReaderWriter<inout T> extends LegacyReader<T> {} // OK
class IntegerReaderWriter<inout T> extends Reader<T> {} // OK
class StringReaderWriter<inout T> extends Writer<T> {} // OK
class Writer<in T> {}
class StringWriter<in T> extends Writer<T> {} // OK
class LegacyReader<T> {}
class NewReader<out T> extends LegacyReader<T> {} // OK
class Reader<out T> {}
class IntegerReader<out T> extends Reader<T> {} // OK
class ReaderWriter<inout T> { /* ... */ }
main() {
ReaderWriter<int> intReader = ReaderWriter<int>();
}
class Writer<in T> { /* ... */ }
main() {
Writer<int> intWriter = Writer<Object>();
}
class Reader<out T> { /* ... */ }
main() {
Reader<Object> objectReader = Reader<int>();
}
class Reader<out T> {
// Compile-time error: Can't use 'out' type variable 'T' in an 'in' position.
T readableWritableValue;
// OK
final T readableValue;
}
class Writer<in T> {
// Compile-time error: Can't use 'in' type variable 'T' in an 'out' position.