-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect type arguments provided to methods and static methods (previously they were being ignored). This also fixes a long-standing issue that's been hanging out as a TODO in `example.abra` forever.
- Loading branch information
Showing
3 changed files
with
273 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,18 @@ | ||
val hello = "hello" | ||
|
||
type Person { | ||
firstName: String | ||
lastName: String | ||
//type Foo<T> { | ||
// func make<T>(): Foo<T> = Foo() | ||
//} | ||
|
||
func getFullName(self): String = self.firstName + " " + self.lastName | ||
func foo(self): Int = hello.length | ||
} | ||
//val f: Foo<Float> = Foo.make<Int>() | ||
//val _: Int = f | ||
|
||
val p = Person(firstName: "Ken", lastName: "Gorab") | ||
println(p.foo()) | ||
//func make<T>(): T[] = [] | ||
//val arr: Float[] = make<Int>() | ||
|
||
//func f(i: Int) { | ||
// println(i + hello.length) | ||
//} | ||
// | ||
//f(0) | ||
//func make<T>(t: T): T[] = [] | ||
//val arr = make<Int>("f") | ||
|
||
// TODO: So should this | ||
//func makeArray<U>(): U[] = [] | ||
//type Foo<T> { | ||
// a: T[] = makeArray() | ||
//} | ||
func makeArray<U>(): U[] = [] | ||
type Foo<T> { | ||
a: T[] = makeArray() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.