File tree 1 file changed +14
-5
lines changed
1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -120,11 +120,20 @@ static FlakeInput parseFlakeInput(EvalState & state,
120
120
expectType (state, nString, *attr.value , *attr.pos );
121
121
input.follows = parseInputPath (attr.value ->string .s );
122
122
} else {
123
- if (attr.value ->type () == nString)
124
- attrs.emplace (attr.name , attr.value ->string .s );
125
- else
126
- throw TypeError (" flake input attribute '%s' is %s while a string is expected" ,
127
- attr.name , showType (*attr.value ));
123
+ switch (attr.value ->type ()) {
124
+ case nString:
125
+ attrs.emplace (attr.name , attr.value ->string .s );
126
+ break ;
127
+ case nBool:
128
+ attrs.emplace (attr.name , Explicit<bool > { attr.value ->boolean });
129
+ break ;
130
+ case nInt:
131
+ attrs.emplace (attr.name , attr.value ->integer );
132
+ break ;
133
+ default :
134
+ throw TypeError (" flake input attribute '%s' is %s while a string, Boolean, or integer is expected" ,
135
+ attr.name , showType (*attr.value ));
136
+ }
128
137
}
129
138
} catch (Error & e) {
130
139
e.addTrace (*attr.pos , hintfmt (" in flake attribute '%s'" , attr.name ));
You can’t perform that action at this time.
0 commit comments