TypeScript/tests/cases/fourslash/defaultParamsAndContextualTypes.ts

19 lines
507 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
/// <reference path="fourslash.ts"/>
////interface FooOptions {
//// text?: string;
////}
////interface Foo {
//// bar(xy: string, options?: FooOptions): void;
////}
////var o: Foo = {
//// bar: function (x/*1*/y, opt/*2*/ions = {}) {
//// // expect xy to have type string, and options to have type FooOptions in here
//// }
////}
goTo.marker('1');
2014-10-07 20:30:27 +02:00
verify.quickInfoIs('(parameter) xy: string');
2014-07-13 01:04:16 +02:00
goTo.marker('2');
2014-10-07 20:30:27 +02:00
verify.quickInfoIs('(parameter) options: FooOptions');