2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/listFailure.ts ===
|
|
|
|
module Editor {
|
|
|
|
>Editor : typeof Editor
|
|
|
|
|
|
|
|
export class Buffer {
|
|
|
|
>Buffer : Buffer
|
|
|
|
|
|
|
|
lines: List<Line> = ListMakeHead<Line>();
|
|
|
|
>lines : List<Line>
|
2014-08-19 04:56:03 +02:00
|
|
|
>List : List<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>Line : Line
|
|
|
|
>ListMakeHead<Line>() : List<Line>
|
|
|
|
>ListMakeHead : <U>() => List<U>
|
|
|
|
>Line : Line
|
|
|
|
|
|
|
|
addLine(lineText: string): List<Line> {
|
|
|
|
>addLine : (lineText: string) => List<Line>
|
|
|
|
>lineText : string
|
2014-08-19 04:56:03 +02:00
|
|
|
>List : List<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>Line : Line
|
|
|
|
|
|
|
|
var line: Line = new Line();
|
|
|
|
>line : Line
|
|
|
|
>Line : Line
|
|
|
|
>new Line() : Line
|
|
|
|
>Line : typeof Line
|
|
|
|
|
|
|
|
var lineEntry = this.lines.add(line);
|
|
|
|
>lineEntry : List<Line>
|
|
|
|
>this.lines.add(line) : List<Line>
|
|
|
|
>this.lines.add : (data: Line) => List<Line>
|
|
|
|
>this.lines : List<Line>
|
|
|
|
>this : Buffer
|
|
|
|
>lines : List<Line>
|
|
|
|
>add : (data: Line) => List<Line>
|
|
|
|
>line : Line
|
|
|
|
|
|
|
|
return lineEntry;
|
|
|
|
>lineEntry : List<Line>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function ListRemoveEntry<U>(entry: List<U>): List<U> {
|
|
|
|
>ListRemoveEntry : <U>(entry: List<U>) => List<U>
|
|
|
|
>U : U
|
|
|
|
>entry : List<U>
|
2014-08-19 04:56:03 +02:00
|
|
|
>List : List<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>U : U
|
2014-08-19 04:56:03 +02:00
|
|
|
>List : List<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>U : U
|
|
|
|
|
|
|
|
return entry;
|
|
|
|
>entry : List<U>
|
|
|
|
}
|
|
|
|
|
|
|
|
export function ListMakeHead<U>(): List<U> {
|
|
|
|
>ListMakeHead : <U>() => List<U>
|
|
|
|
>U : U
|
2014-08-19 04:56:03 +02:00
|
|
|
>List : List<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>U : U
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function ListMakeEntry<U>(data: U): List<U> {
|
|
|
|
>ListMakeEntry : <U>(data: U) => List<U>
|
|
|
|
>U : U
|
|
|
|
>data : U
|
|
|
|
>U : U
|
2014-08-19 04:56:03 +02:00
|
|
|
>List : List<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>U : U
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
class List<T> {
|
|
|
|
>List : List<T>
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
public next: List<T>;
|
|
|
|
>next : List<T>
|
2014-08-19 04:56:03 +02:00
|
|
|
>List : List<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>T : T
|
|
|
|
|
|
|
|
add(data: T): List<T> {
|
|
|
|
>add : (data: T) => List<T>
|
|
|
|
>data : T
|
|
|
|
>T : T
|
2014-08-19 04:56:03 +02:00
|
|
|
>List : List<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>T : T
|
|
|
|
|
|
|
|
this.next = ListMakeEntry(data);
|
|
|
|
>this.next = ListMakeEntry(data) : List<T>
|
|
|
|
>this.next : List<T>
|
|
|
|
>this : List<T>
|
|
|
|
>next : List<T>
|
|
|
|
>ListMakeEntry(data) : List<T>
|
|
|
|
>ListMakeEntry : <U>(data: U) => List<U>
|
|
|
|
>data : T
|
|
|
|
|
|
|
|
return this.next;
|
|
|
|
>this.next : List<T>
|
|
|
|
>this : List<T>
|
|
|
|
>next : List<T>
|
|
|
|
}
|
|
|
|
|
|
|
|
popEntry(head: List<T>): List<T> {
|
|
|
|
>popEntry : (head: List<T>) => List<T>
|
|
|
|
>head : List<T>
|
2014-08-19 04:56:03 +02:00
|
|
|
>List : List<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>T : T
|
2014-08-19 04:56:03 +02:00
|
|
|
>List : List<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>T : T
|
|
|
|
|
|
|
|
return (ListRemoveEntry(this.next));
|
|
|
|
>(ListRemoveEntry(this.next)) : List<T>
|
|
|
|
>ListRemoveEntry(this.next) : List<T>
|
|
|
|
>ListRemoveEntry : <U>(entry: List<U>) => List<U>
|
|
|
|
>this.next : List<T>
|
|
|
|
>this : List<T>
|
|
|
|
>next : List<T>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Line {}
|
|
|
|
>Line : Line
|
|
|
|
}
|