File tree Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,9 @@ import {
2626 Function ,
2727 Element ,
2828 ElementKind ,
29- Global ,
3029 Field ,
31- Class
30+ Class ,
31+ TypedElement
3232} from "./program" ;
3333
3434import {
@@ -1218,8 +1218,8 @@ export class Flow {
12181218 case ExpressionId . GlobalGet : {
12191219 // TODO: this is inefficient because it has to read a string
12201220 let global = assert ( this . parentFunction . program . elementsByName . get ( assert ( getGlobalGetName ( expr ) ) ) ) ;
1221- assert ( global . kind == ElementKind . GLOBAL ) ;
1222- return canConversionOverflow ( ( < Global > global ) . type , type ) ;
1221+ assert ( global . kind == ElementKind . GLOBAL || global . kind == ElementKind . ENUMVALUE ) ;
1222+ return canConversionOverflow ( ( < TypedElement > global ) . type , type ) ;
12231223 }
12241224
12251225 case ExpressionId . Binary : {
Original file line number Diff line number Diff line change 1+ {
2+ "asc_flags" : [
3+ ],
4+ "stderr" : [
5+ " AS200: Conversion from type 'i32' to 'bool' requires an explicit cast." ,
6+ " EOF"
7+ ]
8+ }
Original file line number Diff line number Diff line change 1+ enum Bar {
2+ Baz
3+ }
4+
5+ function foo ( ) : boolean {
6+ return Bar . Baz ;
7+ }
8+
9+ foo ( ) ;
10+
11+ ERROR ( "EOF" ) ;
You can’t perform that action at this time.
0 commit comments