Untyped variadic function types should not be permitted in strict mode
[hiphop-php.git] / hphp / hack / test / typecheck / typing_fail_duck.php
blob2acb35f3d4d666a1299cd2ae251b87b6ef0d854f
1 <?hh // strict
2 /**
3 * Copyright (c) 2014, Facebook, Inc.
4 * All rights reserved.
6 * This source code is licensed under the BSD-style license found in the
7 * LICENSE file in the "hack" directory of this source tree. An additional grant
8 * of patent rights can be found in the PATENTS file in the same directory.
12 // A simple duck typing example
14 class DoesRender {
16 public function render(): string {
17 return "";
21 class MyClass1 {
23 public function otherStuff(): string {
24 return "I know how to do other stuff too!";
27 public function render(string $x = ""): string {
28 return "Yoohoo I know how to render";
32 function test(DoesRender $obj): string {
33 return $obj->render();
36 function main(): void {
37 $my_string = test(new MyClass1());