Skip to content

Commit

Permalink
Add regressoin test for #914
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarmil committed Feb 21, 2018
1 parent cc3678d commit adc74c4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/WebSharper.Tests/Regression.fs
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,21 @@ module TupledArgOpt =

[<JavaScript>]
module Bug906 =
// bug #906, this was throwing a compile-time error 'not a named type'
type Alias<'T> = 'T
type Record<'T> = { x : Alias<'T> }

[<Struct>]
type Normal<'T, 'U> = Ok of 'T | Error

[<JavaScript>]
module Bug914 =
type Alias<'T> = Normal<'T, string>
let f i =
match Ok i : Alias<int> with
| Ok x -> string x
| Error -> "error"

[<JavaScript>]
let Tests =
TestCategory "Regression" {
Expand Down Expand Up @@ -841,6 +853,10 @@ let Tests =
equal r2 "13"
}

Test "#914 generic struct type alias" {
equal (Bug914.f 42) "42"
}

//Test "Recursive module value" {
// equal (moduleFuncValue 0) 5
//}
Expand Down

0 comments on commit adc74c4

Please sign in to comment.