static func — examples
← all topics · 53 examples · page 2 of 2 · raw source ↓
Rejected at compile time: ES1010
// E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript).
// provenance: ILEmitterTests_StaticFunc.cs::StaticFunc_RejectsBareReturn topic: static-func status: unverified
// verified behavior: reports diagnostic ES1010
namespace Test
static Bad {
return 1
}Rejected at compile time: ES1010
// E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript).
// provenance: ILEmitterTests_StaticFunc.cs::StaticFunc_RejectsTopLevelStatements topic: static-func status: unverified
// verified behavior: reports diagnostic ES1010
namespace Test
static Bad {
let X: int = 1
if true { let y = 2 }
}Compiles
// E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript).
// provenance: MatchTypePatternTests.cs::Dogfood_SymbolTable_CompilesAndRuns topic: static-func status: unverified
// compiles cleanly (no auto-run claim was extracted)
type Point/0; static origin; func translate; x: int | raw 42