Skip to content

Commit

Permalink
Update: infer method return type + bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
koczkatamas committed Feb 11, 2018
1 parent 470cce0 commit 67329ca
Show file tree
Hide file tree
Showing 19 changed files with 77 additions and 77 deletions.
12 changes: 6 additions & 6 deletions CustomDecoder/schemaStates/2_TypesInferred.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ XorByte::decode(src: TsArray<TsNumber>): TsArray<TsNumber>
- Call [void]
- MethodReference [TsArray<TsNumber>::push]
- LocalVar: dest [TsArray<TsNumber>]
- Binary: ^ [void]
- Call [void]
- Binary: ^ [TsNumber]
- Call [TsNumber]
- MethodReference [TsArray<TsNumber>::get]
- MethodArgument: src [TsArray<TsNumber>]
- LocalVar: i [TsNumber]
Expand Down Expand Up @@ -58,14 +58,14 @@ Base64::decode(src: TsArray<TsNumber>): TsArray<TsNumber>
- Variable: ch0 [TsNumber]
- Call [TsNumber]
- MethodReference (this) [Base64::decodeChar]
- Call [void]
- Call [TsNumber]
- MethodReference [TsArray<TsNumber>::get]
- MethodArgument: src [TsArray<TsNumber>]
- LocalVar: i [TsNumber]
- Variable: ch1 [TsNumber]
- Call [TsNumber]
- MethodReference (this) [Base64::decodeChar]
- Call [void]
- Call [TsNumber]
- MethodReference [TsArray<TsNumber>::get]
- MethodArgument: src [TsArray<TsNumber>]
- Binary: + [TsNumber]
Expand All @@ -74,7 +74,7 @@ Base64::decode(src: TsArray<TsNumber>): TsArray<TsNumber>
- Variable: ch2 [TsNumber]
- Call [TsNumber]
- MethodReference (this) [Base64::decodeChar]
- Call [void]
- Call [TsNumber]
- MethodReference [TsArray<TsNumber>::get]
- MethodArgument: src [TsArray<TsNumber>]
- Binary: + [TsNumber]
Expand All @@ -83,7 +83,7 @@ Base64::decode(src: TsArray<TsNumber>): TsArray<TsNumber>
- Variable: ch3 [TsNumber]
- Call [TsNumber]
- MethodReference (this) [Base64::decodeChar]
- Call [void]
- Call [TsNumber]
- MethodReference [TsArray<TsNumber>::get]
- MethodArgument: src [TsArray<TsNumber>]
- Binary: + [TsNumber]
Expand Down
2 changes: 1 addition & 1 deletion CustomDecoder/schemaStates/3_OverlayTypesInlined.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ XorByte::decode(src: OneArray<OneNumber>): OneArray<OneNumber>
- Call [void]
- MethodReference [OneArray<T>::add]
- LocalVar: dest [OneArray<OneNumber>]
- Binary: ^ [void]
- Binary: ^ [OneNumber]
- Call [T]
- MethodReference [OneArray<T>::get]
- MethodArgument: src [OneArray<OneNumber>]
Expand Down
2 changes: 1 addition & 1 deletion CustomDecoder/schemaStates/4_ExtendedInfoAdded.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ XorByte::decode(src: OneArray<OneNumber>): OneArray<OneNumber>
- Call [void]
- MethodReference [OneArray<T>::add]
- LocalVar: dest [OneArray<OneNumber>]
- Binary: ^ [void]
- Binary: ^ [OneNumber]
- Call [T]
- MethodReference [OneArray<T>::get]
- MethodArgument: src [OneArray<OneNumber>]
Expand Down
40 changes: 20 additions & 20 deletions JsonParseTest/schemaStates/2_TypesInferred.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ main()
- Call [void]
- MethodReference (static, throws) [OneError::raise]
- Literal (string): "expected to be object!" [TsString]
- Variable: obj1Props [TsArray<OneJProperty>]
- Call [TsArray<OneJProperty>]
- Variable: obj1Props [OneArray<OneJProperty>]
- Call [OneArray<OneJProperty>]
- MethodReference [OneJObject::getProperties]
- Call [OneJObject]
- MethodReference [OneJValue::asObject]
- LocalVar: obj1 [OneJValue]
- If
- Binary: != [OneBoolean]
- InstanceField: length [TsNumber]
- LocalVar: obj1Props [TsArray<OneJProperty>]
- LocalVar: obj1Props [OneArray<OneJProperty>]
- Literal (numeric): "2" [TsNumber]
Then
- ExpressionStatement
Expand All @@ -31,36 +31,36 @@ main()
- Literal (string): "expected 2 properties" [TsString]
- If
- Binary: != [OneBoolean]
- Call [any]
- PropertyAccess (.getName) [any]
- Call [void]
- MethodReference [TsArray<OneJProperty>::get]
- LocalVar: obj1Props [TsArray<OneJProperty>]
- Call [OneString]
- MethodReference [OneJProperty::getName]
- Call [OneJProperty]
- MethodReference [OneArray<OneJProperty>::get]
- LocalVar: obj1Props [OneArray<OneJProperty>]
- Literal (numeric): "0" [TsNumber]
- Literal (string): "a" [TsString]
Then
- ExpressionStatement
- Call [void]
- MethodReference (static, throws) [OneError::raise]
- Literal (string): "expected first property to be named 'a'" [TsString]
- Variable: obj1Prop0Value [any]
- Call [any]
- PropertyAccess (.getValue) [any]
- Call [void]
- MethodReference [TsArray<OneJProperty>::get]
- LocalVar: obj1Props [TsArray<OneJProperty>]
- Variable: obj1Prop0Value [OneJValue]
- Call [OneJValue]
- MethodReference [OneJProperty::getValue]
- Call [OneJProperty]
- MethodReference [OneArray<OneJProperty>::get]
- LocalVar: obj1Props [OneArray<OneJProperty>]
- Literal (numeric): "0" [TsNumber]
- LocalVar: obj1 [OneJValue]
- If
- Binary: || [any]
- Unary (prefix): ! [any]
- Call [any]
- PropertyAccess (.isNumber) [any]
- LocalVar: obj1Prop0Value [any]
- Call [OneBoolean]
- MethodReference [OneJValue::isNumber]
- LocalVar: obj1Prop0Value [OneJValue]
- Binary: != [OneBoolean]
- Call [any]
- PropertyAccess (.asNumber) [any]
- LocalVar: obj1Prop0Value [any]
- Call [OneNumber]
- MethodReference [OneJValue::asNumber]
- LocalVar: obj1Prop0Value [OneJValue]
- Literal (numeric): "1" [TsNumber]
Then
- ExpressionStatement
Expand Down
30 changes: 15 additions & 15 deletions JsonParseTest/schemaStates/3_OverlayTypesInlined.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ main()
- Literal (string): "expected 2 properties" [OneString]
- If
- Binary: != [OneBoolean]
- Call [any]
- PropertyAccess (.getName) [any]
- Call [T]
- MethodReference [OneArray<T>::get]
- Call [OneString]
- MethodReference [OneJProperty::getName]
- Call [OneJProperty]
- MethodReference [OneArray<OneJProperty>::get]
- LocalVar: obj1Props [OneArray<OneJProperty>]
- Literal (numeric): "0" [OneNumber]
- Literal (string): "a" [OneString]
Expand All @@ -43,24 +43,24 @@ main()
- Call [void]
- MethodReference (static, throws) [OneError::raise]
- Literal (string): "expected first property to be named 'a'" [OneString]
- Variable: obj1Prop0Value [any]
- Call [any]
- PropertyAccess (.getValue) [any]
- Call [T]
- MethodReference [OneArray<T>::get]
- Variable: obj1Prop0Value [OneJValue]
- Call [OneJValue]
- MethodReference [OneJProperty::getValue]
- Call [OneJProperty]
- MethodReference [OneArray<OneJProperty>::get]
- LocalVar: obj1Props [OneArray<OneJProperty>]
- Literal (numeric): "0" [OneNumber]
- LocalVar: obj1 [OneJValue]
- If
- Binary: || [any]
- Unary (prefix): ! [any]
- Call [any]
- PropertyAccess (.isNumber) [any]
- LocalVar: obj1Prop0Value [any]
- Call [OneBoolean]
- MethodReference [OneJValue::isNumber]
- LocalVar: obj1Prop0Value [OneJValue]
- Binary: != [OneBoolean]
- Call [any]
- PropertyAccess (.asNumber) [any]
- LocalVar: obj1Prop0Value [any]
- Call [OneNumber]
- MethodReference [OneJValue::asNumber]
- LocalVar: obj1Prop0Value [OneJValue]
- Literal (numeric): "1" [OneNumber]
Then
- ExpressionStatement
Expand Down
30 changes: 15 additions & 15 deletions JsonParseTest/schemaStates/4_ExtendedInfoAdded.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ main()
- Literal (string): "expected 2 properties" [OneString]
- If
- Binary: != [OneBoolean]
- Call [any]
- PropertyAccess (.getName) [any]
- Call [T]
- MethodReference [OneArray<T>::get]
- Call [OneString]
- MethodReference [OneJProperty::getName]
- Call [OneJProperty]
- MethodReference [OneArray<OneJProperty>::get]
- LocalVar: obj1Props [OneArray<OneJProperty>]
- Literal (numeric): "0" [OneNumber]
- Literal (string): "a" [OneString]
Expand All @@ -43,24 +43,24 @@ main()
- Call [void]
- MethodReference (static, throws) [OneError::raise]
- Literal (string): "expected first property to be named 'a'" [OneString]
- Variable: obj1Prop0Value [any]
- Call [any]
- PropertyAccess (.getValue) [any]
- Call [T]
- MethodReference [OneArray<T>::get]
- Variable: obj1Prop0Value [OneJValue]
- Call [OneJValue]
- MethodReference [OneJProperty::getValue]
- Call [OneJProperty]
- MethodReference [OneArray<OneJProperty>::get]
- LocalVar: obj1Props [OneArray<OneJProperty>]
- Literal (numeric): "0" [OneNumber]
- LocalVar: obj1 [OneJValue]
- If
- Binary: || [any]
- Unary (prefix): ! [any]
- Call [any]
- PropertyAccess (.isNumber) [any]
- LocalVar: obj1Prop0Value [any]
- Call [OneBoolean]
- MethodReference [OneJValue::isNumber]
- LocalVar: obj1Prop0Value [OneJValue]
- Binary: != [OneBoolean]
- Call [any]
- PropertyAccess (.asNumber) [any]
- LocalVar: obj1Prop0Value [any]
- Call [OneNumber]
- MethodReference [OneJValue::asNumber]
- LocalVar: obj1Prop0Value [OneJValue]
- Literal (numeric): "1" [OneNumber]
Then
- ExpressionStatement
Expand Down
6 changes: 3 additions & 3 deletions JsonParseTest/schemaStates/5_TypesInferredAgain.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ main()
- MethodReference (static, throws) [OneError::raise]
- Literal (string): "expected to be object!" [OneString]
- Variable: obj1Props [OneArray<OneJProperty>]
- Call [TsArray<OneJProperty>]
- Call [OneArray<OneJProperty>]
- MethodReference [OneJObject::getProperties]
- Call [OneJObject]
- MethodReference [OneJValue::asObject]
Expand All @@ -34,7 +34,7 @@ main()
- Call [OneString]
- MethodReference [OneJProperty::getName]
- Call [OneJProperty]
- MethodReference [OneArray<T>::get]
- MethodReference [OneArray<OneJProperty>::get]
- LocalVar: obj1Props [OneArray<OneJProperty>]
- Literal (numeric): "0" [OneNumber]
- Literal (string): "a" [OneString]
Expand All @@ -47,7 +47,7 @@ main()
- Call [OneJValue]
- MethodReference [OneJProperty::getValue]
- Call [OneJProperty]
- MethodReference [OneArray<T>::get]
- MethodReference [OneArray<OneJProperty>::get]
- LocalVar: obj1Props [OneArray<OneJProperty>]
- Literal (numeric): "0" [OneNumber]
- LocalVar: obj1 [OneJValue]
Expand Down
2 changes: 1 addition & 1 deletion MultiLangTest/results/MultiLangTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class Calculator {
public:
void calc() {
int calc() {
return 4;
}

Expand Down
2 changes: 1 addition & 1 deletion MultiLangTest/results/MultiLangTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class Calculator
{
public void Calc()
public int Calc()
{
return 4;
}
Expand Down
2 changes: 1 addition & 1 deletion MultiLangTest/results/MultiLangTest.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func NewCalculator() *Calculator {
return this
}

func (this *Calculator) Calc() {
func (this *Calculator) Calc() int {
return 4
}

Expand Down
2 changes: 1 addition & 1 deletion MultiLangTest/results/MultiLangTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Calculator {
public void calc() throws Exception
public Integer calc() throws Exception
{
return 4;
}
Expand Down
2 changes: 1 addition & 1 deletion MultiLangTest/results/MultiLangTest.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Calculator {
func calc() -> Void {
func calc() -> Int {
return 4
}
}
Expand Down
2 changes: 1 addition & 1 deletion MultiLangTest/schemaStates/2_TypesInferred.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Calculator::calc(): void
Calculator::calc(): TsNumber
- Return
- Literal (numeric): "4" [TsNumber]

Expand Down
2 changes: 1 addition & 1 deletion MultiLangTest/schemaStates/3_OverlayTypesInlined.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Calculator::calc(): void
Calculator::calc(): OneNumber
- Return
- Literal (numeric): "4" [OneNumber]

Expand Down
2 changes: 1 addition & 1 deletion MultiLangTest/schemaStates/4_ExtendedInfoAdded.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Calculator::calc(): void
Calculator::calc(): OneNumber
- Return
- Literal (numeric): "4" [OneNumber]

Expand Down
2 changes: 1 addition & 1 deletion MultiLangTest/schemaStates/5_TypesInferredAgain.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Calculator::calc(): void
Calculator::calc(): OneNumber
- Return
- Literal (numeric): "4" [OneNumber]

Expand Down
2 changes: 1 addition & 1 deletion overlay/schemaStates/1_Converted.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ TsArray::push(item: T): void
- MethodReference (this) [OneArray<T>::add]
- MethodArgument: item [T]

TsArray::get(index: TsNumber): void
TsArray::get(index: TsNumber): T
- Return
- Call [T]
- MethodReference (this) [OneArray<T>::get]
Expand Down
6 changes: 3 additions & 3 deletions stdlib/schemaStates/0_Converted.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ OneJProperty::getName(): OneString
OneJProperty::getValue(obj: OneJValue): OneJValue
<no body>

OneJObject::getProperties(): TsArray<OneJProperty>
OneJObject::getProperties(): OneArray<OneJProperty>
<no body>

OneJObject::count(): OneNumber
<no body>

OneJObject::names(): TsArray<OneString>
OneJObject::names(): OneArray<OneString>
<no body>

OneJObject::get(name: TsString): OneJValue
Expand Down Expand Up @@ -148,7 +148,7 @@ OneJValue::asBool(): OneBoolean
OneJValue::asObject(): OneJObject
<no body>

OneJValue::getArrayItems(): TsArray<OneJValue>
OneJValue::getArrayItems(): OneArray<OneJValue>
<no body>

OneJson::parse(str: TsString): OneJValue [static]
Expand Down
6 changes: 3 additions & 3 deletions stdlib/schemaStates/0_Original.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ OneJProperty::getName(): OneString
OneJProperty::getValue(obj: OneJValue): OneJValue
<no body>

OneJObject::getProperties(): TsArray<OneJProperty>
OneJObject::getProperties(): OneArray<OneJProperty>
<no body>

OneJObject::count(): OneNumber
<no body>

OneJObject::names(): TsArray<OneString>
OneJObject::names(): OneArray<OneString>
<no body>

OneJObject::get(name: TsString): OneJValue
Expand Down Expand Up @@ -148,7 +148,7 @@ OneJValue::asBool(): OneBoolean
OneJValue::asObject(): OneJObject
<no body>

OneJValue::getArrayItems(): TsArray<OneJValue>
OneJValue::getArrayItems(): OneArray<OneJValue>
<no body>

OneJson::parse(str: TsString): OneJValue [static]
Expand Down

0 comments on commit 67329ca

Please sign in to comment.