Skip to content

Instantly share code, notes, and snippets.

View eernstg's full-sized avatar

Erik Ernst eernstg

  • Google
  • Aarhus, Denmark
View GitHub Profile
@eernstg
eernstg / GenericMethodSyntax.md
Last active August 29, 2017 13:51
INFORMAL SPECIFICATION: Generic Method Syntax

This document is now obsolete, please refer to the current version.

Feature: Generic Method Syntax

This document is an informal specification of the support for generic methods and functions which has been implemented in dart2js with option --generic-method-syntax, starting with commit acc5f59. In SDK 1.21 this feature is available by default (i.e., also without the option) in the virtual machine and the analyzer, as well as in dart2js.

The motivation for having this feature is that it enables partial support for generic methods and functions, thus providing a bridge between not having generic methods and having full support for generic methods. In particular, code declaring and using generic methods may be type checked and compiled in strong mode, and the same code will now be acceptable in standard (non-

@eernstg
eernstg / GenericFunctionTypeAlias.md
Last active September 2, 2017 06:16
INFORMAL SPECIFICATION: Generic Function Type Alias

This document is now obsolete, please refer to the current version.

Feature: Generic Function Type Alias

Status: Under implementation.

This document is an informal specification of a feature supporting the definition of function type aliases using a more expressive syntax than the one available today, such that it also covers generic function types. The feature also introduces syntax for specifying function types directly, such

@eernstg
eernstg / naiveTypeArguments.diff
Last active November 7, 2017 08:29
A patch for reflectable (branch use_build) adding a naive and probably still buggy ability to handle some actual type arguments
diff --git a/reflectable/lib/mirrors.dart b/reflectable/lib/mirrors.dart
index 8d3cd64..09ece0e 100644
--- a/reflectable/lib/mirrors.dart
+++ b/reflectable/lib/mirrors.dart
@@ -719,6 +719,17 @@ abstract class TypeMirror implements DeclarationMirror {
/// [TypeRelationsCapability].
List<TypeMirror> get typeArguments;
+ /// An immutable list with [Type] values for the actual type arguments
+ /// of this type.
@eernstg
eernstg / GenericConstructors.md
Last active November 24, 2017 15:52
Informal specification of generic constructors

Feature: Generic Constructors

Author: eernst@

Status: Under discussion.

Version: 0.1 (2017-11-24)

This document is an informal specification of the support in Dart 2 for generic constructors, that is, constructors that can receive their "own"

@eernstg
eernstg / AboutSpecParser.md
Last active December 7, 2017 12:07
A few words on the specification parser

The Dart Specification Parser

Author: eernst@

Version: 0.1

We have created a Dart specification parser, built on a grammar specification Dart.g, which is transformed into a working parser by the tool ANTLR v3, using a couple of helper files (in particular, spec_parse.py and spec_parser). This document gives a short introduction to what it is, and some motivations for why we have it, along with an outline of the consequences for the testing workflow when we have a specification parser.

Motivation

@eernstg
eernstg / class-interfaces.md
Last active January 17, 2018 13:39
Feature specification of class interfaces in Dart

Flattened Interfaces

Author: eernst@.

Version: 0.1 (2018-01-10)

Status: Under discussion.

This document is a feature specification of the notion of a flattened interface in Dart that generalizes the concept of an

This document is now obsolete, please refer to the version in the SDK repository.

Informal Specification: Parameters that are Covariant due to Class Type Parameters

Owner: eernst@

Status: Implemented.

Version: 0.5 (2018-02-01)

@eernstg
eernstg / NoSuchMethodForwarding.md
Last active March 22, 2018 13:34
Informal specification of noSuchMethod forwarding

This document is now obsolete, please refer to the version in the SDK repository.

NoSuchMethod Forwarding

Author: eernst@

Status: Under implementation.

Version: 0.6 (2018-03-22)

@eernstg
eernstg / generic-function-instantiation.md
Last active April 5, 2018 06:50
Dart 2 feature specification of generic function instantiation

This document may be obsolete, or it may be a proposed new version; if in doubt please consider the version in the SDK repository (which may not yet exist).

Generic Function Instantiation

Author: eernst@.

Version: 0.3 (2018-04-05)

bool b = false;
void doWork(int i) => print("Do work ($i)");
void bailOut(int i) => print("Bail out ($i)");
void acquire() => print("Acquire the resource");
void release() => print("Release the resource");
// Consider: We want to simplify the following control flow.