[FIX] Add some more tests
This commit is contained in:
committed by
TeamCityServer
parent
d7e00a5907
commit
0181c80ddb
+53
@@ -0,0 +1,53 @@
|
||||
FILE: untypedPropertyWithBackingFieldUsage.kt
|
||||
public final val simpleNoTypeBlock: <ERROR TYPE REF: Unresolved name: field>
|
||||
public get(): <ERROR TYPE REF: Unresolved name: field> {
|
||||
^ <Unresolved name: field>#
|
||||
}
|
||||
public final val simpleNoTypeExpression: <ERROR TYPE REF: Unresolved name: field>
|
||||
public get(): <ERROR TYPE REF: Unresolved name: field> {
|
||||
^ <Unresolved name: field>#
|
||||
}
|
||||
public final val simpleTypeBlock: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ F|/simpleTypeBlock|
|
||||
}
|
||||
public final val simpleTypeExpression: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ F|/simpleTypeExpression|
|
||||
}
|
||||
public final val withFieldNoTypeBlock: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ <Unresolved name: field>#.R|kotlin/text/toInt|()
|
||||
}
|
||||
public final val withFieldNoTypeExpression: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ <Unresolved name: field>#.R|kotlin/text/toInt|()
|
||||
}
|
||||
public final val withFieldTypeBlock: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ F|/withFieldTypeBlock|.R|kotlin/Double.toInt|()
|
||||
}
|
||||
public final val withFieldTypeExpression: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ F|/withFieldTypeExpression|.R|kotlin/Double.toInt|()
|
||||
}
|
||||
public final val minimalFieldWithInitializer: <ERROR TYPE REF: Cannot infer variable type without initializer / getter / delegate>
|
||||
public get(): <ERROR TYPE REF: Cannot infer variable type without initializer / getter / delegate>
|
||||
public final val minimalFieldWithNoInitializer: <ERROR TYPE REF: Cannot infer variable type without initializer / getter / delegate>
|
||||
public get(): <ERROR TYPE REF: Cannot infer variable type without initializer / getter / delegate>
|
||||
public final val constWithFieldNoTypeBlock: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ Int(10)
|
||||
}
|
||||
public final val constWithFieldNoTypeExpression: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ Int(10)
|
||||
}
|
||||
public final val constWithFieldTypeBlock: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ Int(10)
|
||||
}
|
||||
public final val constWithFieldTypeExpression: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ Int(10)
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
val simpleNoTypeBlock
|
||||
get() {
|
||||
return <!UNRESOLVED_REFERENCE!>field<!>
|
||||
}
|
||||
|
||||
val simpleNoTypeExpression
|
||||
get() = <!UNRESOLVED_REFERENCE!>field<!>
|
||||
|
||||
<!MUST_BE_INITIALIZED!>val simpleTypeBlock: Int<!>
|
||||
get() {
|
||||
return field
|
||||
}
|
||||
|
||||
<!MUST_BE_INITIALIZED!>val simpleTypeExpression: Int<!>
|
||||
get() = field
|
||||
|
||||
val withFieldNoTypeBlock
|
||||
field = 3.14
|
||||
get() {
|
||||
// *TODO: add support for this?
|
||||
return <!UNRESOLVED_REFERENCE!>field<!>.toInt()
|
||||
}
|
||||
|
||||
val withFieldNoTypeExpression
|
||||
field = 3.14
|
||||
get() = <!UNRESOLVED_REFERENCE!>field<!>.toInt()
|
||||
|
||||
val withFieldTypeBlock: Int
|
||||
field = 3.14
|
||||
get() {
|
||||
return field.toInt()
|
||||
}
|
||||
|
||||
val withFieldTypeExpression: Int
|
||||
field = 3.14
|
||||
get() = field.toInt()
|
||||
|
||||
// If * is supported, this is a relevant message
|
||||
// since adding a getter _may_ be enough
|
||||
<!PROPERTY_MUST_HAVE_GETTER!>val minimalFieldWithInitializer
|
||||
field = 1<!>
|
||||
|
||||
<!PROPERTY_MUST_HAVE_GETTER!>val minimalFieldWithNoInitializer
|
||||
<!PROPERTY_FIELD_DECLARATION_MISSING_INITIALIZER!>field: Int<!><!>
|
||||
|
||||
// TODO: redundant backing field?
|
||||
// Or we assume someone may still want
|
||||
// to access it directly via `myProperty#field`?
|
||||
val constWithFieldNoTypeBlock
|
||||
field = 3.14
|
||||
get() = 10
|
||||
|
||||
val constWithFieldNoTypeExpression
|
||||
field = 3.14
|
||||
get() = 10
|
||||
|
||||
val constWithFieldTypeBlock: Int
|
||||
field = 3.14
|
||||
get() = 10
|
||||
|
||||
val constWithFieldTypeExpression: Int
|
||||
field = 3.14
|
||||
get() = 10
|
||||
Reference in New Issue
Block a user