fsprojects / FSharp.Configuration

The FSharp.Configuration project contains type providers for the configuration of .NET projects.
http://fsprojects.github.io/FSharp.Configuration/
Other
114 stars 63 forks source link

YamlConfigProvider fails when using numbers as keys. #92

Closed rasmusm closed 8 years ago

rasmusm commented 8 years ago

I am trying to read a yaml file there are using numbers as keys eg.

test:
    10: 42
    11: 60

but when i run this script

#if INTERACTIVE
#r "FSharp.Configuration.dll"
#endif

open FSharp.Configuration

let [<LiteralAttribute>] test1 = """
test:
    t1: 42
    t2: 60""" 

let [<LiteralAttribute>] test2 = """
test:
    10: 42
    11: 60""" 

type Config1 = YamlConfig< YamlText = test1> // no error
type Config2 = YamlConfig< YamlText = test2> // error

it fails with Script.fs(24,16): error FS3033: The type provider 'FSharp.Configuration.ConfigTypeProvider+FSharpConfigurationProvider' reported an error: The input list was empty. where line 24 are type Config2 = YamlConfig< YamlText = test2> (test1 is just to pin point the problem and do not fail)

Are there a way around that?

vasily-kirichenko commented 8 years ago

Fixed in https://github.com/fsprojects/FSharp.Configuration/pull/98

vasily-kirichenko commented 8 years ago

Published in NuGet 0.6.0