-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Treat optional fields/parameters types as null<> wrapped types.
- Loading branch information
Showing
7 changed files
with
73 additions
and
2 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
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
35 changes: 35 additions & 0 deletions
35
src/test/resources/testData/inlay/haxe.local.variable/OptionalFieldsHints.hx
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package testData.inlay.haxe.local.variable; | ||
typedef SomeTypeDef = { | ||
var normalA:Int; | ||
final normalB:String; | ||
@:optional var optionalC:String; | ||
} | ||
typedef SomeStruct = { | ||
?optinal:Int, | ||
} | ||
class NullWrapping { | ||
public function optionalStruct(s:SomeStruct) { | ||
var x/*<# :Null<Int> #>*/ = s.optinal; | ||
} | ||
public function optionalTypeDef(s:SomeTypeDef) { | ||
var a/*<# :Int #>*/ = s.normalA; | ||
var b/*<# :String #>*/ = s.normalB; | ||
var c/*<# :Null<String> #>*/ = s.optionalC; | ||
} | ||
|
||
public function optionalTypeA(?i:String) { | ||
var x/*<# :Null<String> #>*/ = i; | ||
} | ||
|
||
public function optionalTypeB(?i = "Str") { | ||
var x/*<# :Null<String> #>*/ = i; | ||
} | ||
|
||
public function optionalTypeParameter<T>(?i:T) { | ||
var x/*<# :Null<T> #>*/ = i; | ||
} | ||
|
||
public function defaultType(i = "String") { | ||
var x/*<# :String #>*/ = i; | ||
} | ||
} |