-
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.
Bugs fixed: - Types with unsafe generic parameter constraints could be inferred as element types - Tuple elements without names could cause internal errors Enhancements: - Tweak least upper bound quality heuristic
- Loading branch information
Showing
9 changed files
with
62 additions
and
42 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 |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
] | ||
}, | ||
"ghul.compiler": { | ||
"version": "0.8.43", | ||
"version": "0.8.44", | ||
"commands": [ | ||
"ghul-compiler" | ||
] | ||
|
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
8 changes: 4 additions & 4 deletions
8
integration-tests/semantic/generic-function-argument-type-inference-1/err.expected
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,4 +1,4 @@ | ||
test.ghul: 14,18..14,24: error: no static overload found for function(Ghul.int, Ghul.single), tried Test.GenericFunctionTypeInference.function[T](a: T, b: T) -> T | ||
test.ghul: 24,18..24,40: error: no static overload found for function(Ghul.int[], Ghul.object[]), tried Test.GenericFunctionTypeInference.function[T](a: T, b: T) -> T | ||
test.ghul: 27,18..27,58: error: no static overload found for function(Ghul.int[], Collections.LIST[Ghul.int]), tried Test.GenericFunctionTypeInference.function[T](a: T, b: T) -> T | ||
test.ghul: 28,18..28,40: error: no static overload found for function(Ghul.int[], Ghul.Pipes.Pipe[Ghul.int]), tried Test.GenericFunctionTypeInference.function[T](a: T, b: T) -> T | ||
test.ghul: 13,14..13,20: error: no static overload found for function(Ghul.int, Ghul.single), tried function[T](a: T, b: T) -> T | ||
test.ghul: 24,14..24,36: error: no static overload found for function(Ghul.int[], System.ISpanFormattable[]), tried function[T](a: T, b: T) -> T | ||
test.ghul: 27,14..27,54: error: no static overload found for function(Ghul.int[], Collections.LIST[Ghul.int]), tried function[T](a: T, b: T) -> T | ||
test.ghul: 28,14..28,36: error: no static overload found for function(Ghul.int[], Ghul.Pipes.Pipe[Ghul.int]), tried function[T](a: T, b: T) -> T |
43 changes: 21 additions & 22 deletions
43
integration-tests/semantic/generic-function-argument-type-inference-1/test.ghul
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,34 +1,33 @@ | ||
namespace Test.GenericFunctionTypeInference is | ||
use Collections; | ||
use Collections; | ||
|
||
entry() is | ||
function(1, 2); | ||
function(1.0, 2.0); | ||
entry() is | ||
function(1, 2); | ||
|
||
function(1.0, 2.0); | ||
|
||
function("a", "b"); | ||
function("a", "b"); | ||
|
||
function(true, false); | ||
function(true, false); | ||
|
||
// expect an error | ||
function(1, 2.0); | ||
// expect an error | ||
function(1, 2.0); | ||
|
||
function([1234], [5678]); | ||
function([1234], [5678]); | ||
|
||
|
||
function([1, 2.0], [3, 4.0]); | ||
function([1, 2.0], [3, 4.0]); | ||
|
||
function([1, 2.0, "a"], [3, 4.0, "b"]); | ||
function([1, 2.0, "a"], [3, 4.0, "b"]); | ||
|
||
// expect an error | ||
function([1, 2, 3], [4, 5, 6.0]); | ||
// expect error | ||
// infers a not very useful interface - LUB needs tuning | ||
function([1, 2, 3], [4, 5, 6.0]); | ||
|
||
// expect errors. Note these don't work in C# either: | ||
function([1234, 5678], LIST[int]([91011, 121314])); | ||
function([1, 2, 3], [4, 5, 6] |); | ||
si | ||
// expect errors. Note these don't work in C# either: | ||
function([1234, 5678], LIST[int]([91011, 121314])); | ||
function([1, 2, 3], [4, 5, 6] |); | ||
si | ||
|
||
function[T](a: T, b: T) -> T is | ||
return a; | ||
si | ||
function[T](a: T, b: T) -> T is | ||
return a; | ||
si |
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
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
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
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
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