The following code has a type error like "This expression was expected to have type 'obj' but here has type 'string' "
let fiveDaysForecast (model: CityForecast) =
let fiveDays = model.Days |> List.truncate 5
let city = if model.Country |> String.IsNullOrWhiteSpace then model.City else sprintf "%s, %s" model.City model.Country
View.StackLayout(padding = 20.0, verticalOptions = LayoutOptions.FillAndExpand,
children = [
View.Label(text=city.ToUpper(), textColor=Color.Beige, backgroundColor=Color.FromHex("#0F4D8FAC"), fontSize=40, fontAttributes=FontAttributes.Bold, horizontalTextAlignment=TextAlignment.Center)
empty 20.
View.Grid(
rowdefs=["*"],
coldefs=[ for _ in fiveDays -> "*" ],
children = (fiveDays |> List.mapi (day 0) ) )
])
error for this line of code coldefs=[ for _ in fiveDays -> "*" ], due to the "*"
How should I fix it?
coldefs? - Fyodor Soikincoldefs? - Fyodor Soikincoldefsisstring? Are you sure it's not a list or an array or something like that? - Fyodor Soikin